1 reply [Last post]
Last seen: 17 years 19 weeks ago
Joined: 2003-09-12
Posts: 13
Points: 0

So, I'm trying to get the hang of these em units. I had specified that a class called bodytxt would have a font-size of 0.7em, and on one page everything looked great, but then on another page where it was using the same class everything was nasty small. I didn't write this, but what had happened was that a table was declared with that class, and then a table cell was declared with that class, so I'm guessing it declares everything to be 0.7 em, and then the next time it was called the text was 0.7em of that, right?

Right now, we have no base font-size specified in the body tag in our stylesheet. Should we just make it 100% or what?

Hugo's picture
Last seen: 6 years 2 weeks ago
Joined: 2004-06-06
Posts: 15668
Points: 2806

.7em of .7em might not be pretty!

best to declare it in the body but downsize it to something like 76%
these links explain one take on percentage sizes to use and the problem with nested elements inheriting the parent element size thus becoming a percentage of a percentage, ergo too small which is a pain!



Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me