CSS Icons: Cannot remove top and bottom padding (font awesome)

后端 未结 3 1871
天命终不由人
天命终不由人 2021-01-17 16:13

Here is my fiddle:

http://jsfiddle.net/schmudde/VeA6B/

I cannot remove the top and bottom padding on either side of a font awesome icon:

span         


        
3条回答
  •  滥情空心
    2021-01-17 16:28

    You set borders in span, and line inheriting line-heights in i, that's the problem.

    just add borders to i :

    span {
       line-height: 40%;
         }
    i {
       border: 1px solid red;
       border: 1px solid green;
       padding: 0px;
       margin: 0px;
       display: inline-block;
       width: auto;
       height: auto;
       line-height: inherit;
       vertical-align: baseline;
       background-color: red;
       }
    
       
    

    Fiddle

提交回复
热议问题