Why is it that if I do font-size:70px or 120px, the distance between the top and the text increases?
EDIT : Apparently, I fixed it by changing the line-height. Is there a default line-height?
As you haven't shown any code I will make the assumption that you're not using any styles beyond:
body
{
font-size: 70px;
}
Every browser has a different default stylesheet, so the actual values may vary.
Typically the default line-height is 1em or 100% (same thing). On certain elements such as p and h#, there is a top and bottom margin by default. For p tags, the margin is 1em and for h# it varies widely (1.5em for h1, 1.25em for h2 etc).
em and % values are based off of the font-size. If you have a paragraph element with a font-size of 30px, by default it will have a 30px top and bottom margin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With