Embedded padding/margin in fonts

后端 未结 16 1207
执念已碎
执念已碎 2021-01-08 00:56

It seems that all fonts have some sort of embedded padding or margin. By setting:

margin: 0px;
padding: 0px;

You never get what you want. D

16条回答
  •  既然无缘
    2021-01-08 01:16

    Here is my Opinion

    • The margin is the distance from each side to the neighboring element and the margin property can be set for the top, left, right and bottom of an element
    • padding is the distance between the border of an HTML element and the content within it.

    But in your case you dont really need these both you , as you are interested in font spacing , there is one css property called letter-spacing

    • The letter-spacing property increases or decreases the space between characters in a text

    Try

     h2 {letter-spacing:-3px}
    

    The letter-spacing property is supported in all major browsers.

    Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "inherit".

提交回复
热议问题