Saturday, April 09, 2005

CSS is the go

I'm gradually migrating all my sites to us CSS (Cascading Style Sheets). It's taken me a while to get on board, but I can no longer ignore the advantages that it offers.

I'm not going to go into what CSS is, and what it does here, because it's a pretty big concept, it requires extensice HTML knowledge, and there are better people to write about the intricacies of it. Instead I will focus on the advantages it offers from a SEO prospective.

The biggest advantage I can see is that it allows file sizes to be cut down, especially if the site is 1000 pages or more. For example, if I use a tabe format, and I use the same table format to display each table on all 1000 pages. Rather than having the background color, font, alignment specified in the HTML document for each <td> element, I can specify it once in the CSS file, and just use a class with the element. eg: <td class="CSSclass">. This can be done with just about every tag. This means all the HTML files don't need to have something like <td width="30%" halign="center" valign="top" style="color:#cccccc;"> repeated for every table division. This can halve your file size. Links are another place where this is very useful, especially if you are accustomed to using font tags inside your <a href> tags. When search engines - Google, for example:) crawl the page, they don't look at CSS, just the code in the HTML file. If you have code that contains little more than the actual text that appears on the page, it will be a lot less work for the crawler, and your page will appear to have a higher concentration of information. This has to be better.

Finally, and most important. Using CSS, you can change the color of the scrollbars. This only works on IE5+ but it looks cool.

No comments: