css - Why does changing font-size and line-height screw up my HTML layout? -
i post code if helpful (but it's lot). basically, if change line-height or font-size big value, breaks html layout - specifically, divs seem getting bigger...but don't have text in divs.
any inline element pay attention line-height
:
on block container element content composed of inline-level elements, 'line-height' specifies minimal height of line boxes within element.
in case, have <img>
elements (which inline elements default) inside <div>
elements (which block containers).
changing font-size
implicitly alters pixel value of line-height
, default line-height: normal
, means:
tells user agents set used value "reasonable" value based on font of element.
so, altering either font-size
or line-height
change vertical space inline elements occupy.
Comments
Post a Comment