Why font-family sporadically adds 1px gap between buttons?

后端 未结 8 940
小蘑菇
小蘑菇 2020-12-16 12:13

Please read the question carefully. It\'s not the same as the one about How to remove the space between inline-block elements.

Consider the followin

8条回答
  •  没有蜡笔的小新
    2020-12-16 13:03

    DEMO

    The problem is that there are hidden spaces (a line break and a few tabs counts as a space, just to be clear) between tags. Minimize the HTML or comment the spaces out and everything will work correct:

    body {
      font-family: Arial;
    }
    
    .my-class {
      display: inline-block;
      margin-left: -4px;
      border: 1px solid #cccccc;
      padding: 20px;
    }
    
    
    
      
      JS Bin
    
    
      

提交回复
热议问题