The benefits of using Cascading StyleSheets

Ben Fairless (CSS / Beginner)

You've probably heard of CSS by now, there is quite a hype at the moment about xHTML, CSS, and tableless coding. But what is the big deal?
Well CSS and xHTML are the formats recommended by the W3C to code your site with. Forget complex <td> and <tr> tags, CSS eliminates the need for tables and is all about simplicity.

When you code a site you have to set things for your pages such as font type, font size, font color etc. If you were using ordinary HTML you would have to set every single section of text with <font> tags, if your site layout is pretty complicated you are talking alot of <font> tags, even for just one page not to mention the entire site. If one time you realised that the content font is too dark for some people to read and you wanted to lighten it, with standard HTML <font> tags you would have to spend a long time changing the color for each one. If for example there are 12 <font> tags on your homepage, and all your pages are similar, if you had just 10 pages you would have to go about changing 120 <font> tags just to change the color!

If you decided to use CSS however, this could all be done by only changing 1 tag. This is because the style information for a page is stored seperately in a seperate page called an External Stylesheet. This governs all the pages it is applied to and by changing the one tag in there, all the areas in your pages which rely on that tag for color information would instantly start using the new color information provided.

But CSS doesn't just make fonts easier to change, it can also store information about your entire layout such as what image you want in the background, what you want a link to do when you move the mouse over it, and where abouts the banner goes. Again, this means changes to layouts can be done extremely quickly without the need to change every page

Another thing that is important to be aware of as a web designer is the changes which are being made to how formats work, although you can currently still get away with using HTML presentational elements such as the <font> tag they will soon be obselete and can't be used with Strict DOCTYPEs. Even though they will still work with a transitional DOCTYPE it is better to get into the habit of not using them.

The final benefit of CSS is it improves Search Engine Optimisation (SEO), this is because search engines priortise sites with valid, tableless code and place them higher up in the results rankings. This can make a massive difference to the amount of traffic your site receives so it is definetly worth learning xHTML and, more importantly, the CSS which supports it. You will find that the framework of both xHTML and CSS is really simple and more logical than that of standard HTML.

So what are you waiting for? Start learning CSS today!


© Copyright 2006 - All Rights Reserved - SiteGuts is a part of the Enthonia Content Network