Select Page

The article concerns the following question – Why use CSS? There are a million reasons to use CSS over plain ol’ HTML formatting. This short article will list and explain some of the main reasons to use CSS.

Why use CSS

The main reason to use CSS is the ability to seperate all your styles and formatting from the content of your pages. There are a few “sub” reasons as to why this is good.

Far more styling options – with HTML formatting, there isn’t really much you can do. But when you discover the options available to you with CSS, it’s reasonably simple to create elegant Web pages that look the way you want.

Usability –  CSS allows individual HTML tags to be styled, which means, for example, all of your <h1> tags can be a specific size and colour. It also allows for the HTML class attribute, which can style a specific HTML element – giving further customisation abilities. The sames can be used for the ID attribute.

CSS can also be applied internally (in the Webpage’s <head> section using the <style> tag), and it can also be applied inline, by using the HTML style attribute.

Keep Web pages small in size, by keeping all formatting in a seperate file. This way, the browser only has to download your Website’s styling/formatting codes once, as it is stored in the browser’s cache afterwards. This point applies especially to pages with a lot of similarly formatted content.

If your site uses one stylesheet and you need to change something, modifying the CSS makes the change visible on all pages. For example: if all the pages on your site used the Arial font and you wanted to change it to Verdana, using an external stylesheet would mean just changing the font once, and the change would be made across the entire site.

Future proofing your Website is also a must. All the latest browsers support CSS and CSS is also a W3C Web standard. In new XHTML standards, the HTML <font> tag has been removed – which means CSS must be used instead to format text.

Different CSS can be deployed depending on what kind of browser/system the visitor is using, as well as print and media. Internet Explorer allows for IE conditional comments, which means you can use different CSS depending on on version on IE a visitor is using. This is a great feature which allows you fix some of IE’s down-falls…

Finally, CSS is the way to go, and that’s more than enough to use it. There are many more reasons to use CSS that what has been said here. If you start using CSS, you’ll realise the benefits almost immediately.