I want to break down CSS a little bit today and explain why you should use CSS.
“Why should I use CSS?”
Cause tables are evil! Ok, so maybe I should explain that as well. If you look at the source code for a web page (type Ctl + U in firefox) you will see what appears to be a bunch of weird stuff if you’re not familiar with html. On some websites, you will notice a lot of stuff though, including lots of table, tr, and td tags. This is usually unnecessary. CSS is used to replace all of this. This makes each page lighter and thus faster for a browser to download.
This leads right into the next point. Say you have 200 pages (or more) that use the same design. It can be very difficult to keep all of the pages in the same appearance and even more difficult to make changes. With CSS, all 200 pages can link to one CSS file that has standardized styles in it. This way, you can make changes to the 1 CSS file and see them across the entire site. Although, differences in each page appearance can still occur, it is easier to keep them standardized.
The main concept here is seperating structure from design. This is a concept that Dave Shea expresses well in The Zen of CSS Design. I highly recommend this book to anyone interested in web design. It has lessons on all sorts of topics within design; from layout to typography. Seperating structure and design has some wonderful advantages like accessibility and site bandwidth. With all these reasons though, the number one reason is cause tables are evil!
This is part 1 of 2 for CSS posts for today. Come back later today for “How do I learn CSS?”