I’ve been in the habit of declaring a 62.5% font-size in the body for quite a while and then using EM’s throughout my CSS. It makes it super easy as 1em is then 10px and so forth.
I was thinking about it earlier today but this is probably wrong isn’t it? I use a standard CSS reset beforehand but I’m thinking there’s got to be a better way of going about it and I’m not sure of potential ramifications.
I don’t think it’s wrong as such, and I’ve done it myself as well for a long time. However, I started to run into problems when I gave a font size of, say, 1.2em to a div (so all text would be 12px), and then I had a specific child div in there that needed to be 10px. In that case, I couldn’t apply 1em, because that would be 100% of its container font = 12px anyway.
I mean, it wasn’t an issue to set the text to 10px, it was just messing up the rule “1em = 10px”. Or rather, it because “1em = 10px but only if any parent doesn’t have a font size setting“, and so I didn’t see much advantage to that anymore.
I always thought em’s were handy since they were relative to their container font size — change it somewhere and all it’s children would change with it. I just never really found actual use for it.