css - Will using body {font-size: 10px} change the way ems work? -
i'm trying design responsive layout , i'm using trick make use of ems easier. in body, have this: body {font-size: 10px}
. question is: change way ems work? if set p {font-size: 1em}
10px regardless of screen size?
setting font-size
not change way em
unit works.
if set p {font-size: 1em}
, then, usual css caveats (other style sheets might set font-size
on p
, etc.), font size in p
equal font size of parent, happens default anyway via inheritance (when no style sheet sets font-size
on p
element).
if p
element child of body
, have set body {font-size: 10px}
, then, caveats, p
element’s font size 10 css pixels. size of css pixel depends on device , need not equal physical device pixel; see 5.2. absolute lengths: ‘cm’, ‘mm’, ‘in’, ‘pt’, ‘pc’, ‘px’ units in css values , units module level 3 cr (which more realistic css 2.1).
Comments
Post a Comment