*I'm moving over to Lunarpages hosting so until further notice all comments have been disabled. If you need to get into contact with me, please email me at rileyhater2003@gmail.com and I'll respond as soon as possible. Until everything is done I'll be posting updates on my tumblr: babblative.tumblr.com.

Unnecessary CSS Bloat Nov 20, 22:44

Because everyone steals their CSS from everyone else there are a whole lotta sites out there that have very similar stylesheets (which makes me wonder why there aren’t more allegations of theft out there, but that’s for another topic) and most of the same problems.

1. You do not need to repeat styles throughout the stylesheet. Once will usually suffice. body {font:11px tahoma} p {font:11px tahoma} is wrong, wrong, wrong. You can specify the fonts in the body and not have to specify it, if it’s the same, in DIV’s, tables and yes, even DIV Tables!

Of course, this isn’t too big of a problem when it’s just a few lines. However, when someone continually specifies the colour, font-family, font-size, background colour and even non-existent borders in every single property, that’s when it becomes unnecessary bloat.

2. To hide a border all you need to do is specify border:none;. It really is just that simple, I shit you not. And the only time you should need to use this is if you are mirroring a property with different styles (for example: a {color:#ff0; border-bottom:1px solid #333} > #secondary a {color:#000; border:none})

3. Shortening your values and grouping properties together is in your advantage. Why? Because it cuts down on size, and loading time, and it makes everything look prettier. If you’re unsure as to where you should start then try out CSS Tidy, CSS Shorthand Guide, Introduction to CSS Shorthand, Shortening CSS Codes and Efficient CSS With Shorthand Properties.

In short, if you’re going to lift your styles from someone else, try to make sure that someone else knows what they are doing. Run it through a validator and then through CSSTidy. Or, you know, just learn how to do it yourself.