One is all you need
I like to edit the CSS of sites to improve readability, and sometimes just because I’m bored, and one thing that never fails to frustrate me are those who insist on putting the font styles in every property.
It’s not like that’s a bad thing, if the font size is different for each property. What’s with all this body {font-size:9px; font-family:arial;} p {font-size:9px; font-family:arial;} div.blog {font-size:9px; font-family:arial;} crap? Once you stick it in the body it is repeated throughout the page (with the exception of forms, no?).
body {font:76%/140% Verdana, sans-serif;} is all you need (excuse me, relative font sizes FTW!), use em’s for everything else and only if you need to change the font size in a certain area. Otherwise, bite me.
Edit You will need to specify font settings for tables as well as forms. Instead of repeating code, you can simply use font:inherit; and be done with it.
If you liked this article then why not subscribe to the feed?
On older posts comments are usually closed, so if you'd like to discuss this topic with me then please contact me.
#5
I’m having a really hard time getting used to using .em. I’ve been using .pt for years, but I guess I’ll have to get used to it!
What’s your opinion on Selection styles ? In case you don’t have inspiration for the blogathon ;)
#6
The redundant styles are not only unnecessary, they increase the size of the stylesheet and therefore the page loading time.
And umm… I actually specify font sizes using pixels in my stylesheets. There are disadvantages to using pixels, yes, but there are also advantages. ems also have their advantages and disadvantages. It really depends on the site you are styling, but using points is just impractical (unless it’s for a print stylesheet) because points were created for use with print materials.
#7
Agreed. People just don’t know about ems and percentages, I guess o.O
I was also wondering why you use double percentages. I tried using Google, but couldn’t find much info. I’d appreciate it very much if you could explain :)
Sumaiya Mar 2, 03:55 PM Permalink
Hi I'm Becky, often referred to as The Knitting Hillbilly and Pussybear, owner of this site and general nuisance. I'm a knitter, serial complainer, known whistle blower and I run the ever popular
Add to