problem assigning font size value em for html element
# December 14, 2012 at 7:13 am
The unit of measure em is calculated on the selector’s parent element. Therefore ul li is 1.8 times the base font and ul li em is 3.24 times the base element, because it’s 1.8 * 1.8 (ul li’s font-size).
To solve this, you can either use rem, which is based on the root element (so, the html or body font-size), or you can set ul li e to 1em.
Sorry if my explanation is a bit confusing :)
@Paulie_D Too fast for me :D# December 14, 2012 at 7:25 am
I was thinking that rem support was a bit limited, but couldn’t remember how much so; thanks for the link :)
Just out of interest, do you think it’s still worth the time to use rem, with em fallback, despite the limited support? i.e.:
Or should it be something to keep in mind, but wait until more widespread support?# December 14, 2012 at 7:29 am
>Or should it be something to keep in mind, but wait until more widespread support?
I think this purely because I don’t want to set two properties every time at the moment.
However, if you wanted to future-proof then there is no reason you couldn’t use both now (of course the rem setting should be after the em setting….no?).
Personal choice I guess.# December 14, 2012 at 7:40 am
This reply has been reported for inappropriate content.
REM with a PX fallback is how I roll for typography related sizing.
I actually use a bunch of different measurements in stylesheets, PX for breakpoints, REM’s for font sizing and percentages for elements.
You must be logged in to reply to this topic.