Introduction to CSS

CSS is the yang to HTML's yin. You used to be able to design a website using HTML code for both the structure and the presentation, but the latest standards demand that these two areas are separated distinctly - the structure being handled by the HTML and the presentation by CSS.

So why should we bother learning CSS; what's wrong with the old way of doing things? Well, HTML was never intended to be used as a presentation tool. The word markup is used in its name because it was always designed as a way of marking up the various section of a web page - headings, paragraphs, images etc - but not as a way to actually style those sections. The problem was that before long web designers were demanding a way to arrange and format their pages to make them look more interesting. In response to this, a number of presentational tags were tacked on to the HTML standard - things such as the <font> and <center> tags. These were never intended to be permanent solutions; rather they were a quick fix to a problem that demanded a more rigorous solution.

Before too long this rigorous, correct solution was born, in the form of Cascading Style Sheets, or CSS. Unfortunately by this time everyone had become accustomed to using the quick-fix solutions, and were reluctant to change to these newer, seemingly complicated methods.

But now the powers that be have decided that enough is enough, and the quick-fix solutions have been officially deprecated, so that they are no longer part of the formal standard. They will continue to work for a good while yet, but that should not be an excuse to carry on using them. As you will discover, CSS is a far more powerful and flexible solution, giving you complete control over every single aspect of your web pages. This is something that the quick-fix solutions simply cannot offer.

With CSS we are able to separate content and style as intended. We can store all of our styling and presentation information in a separate document, rather than including it in the code of our individual web pages. This means that making changes to our style is infinitely easier than it used to be. Suppose you have a website with 50 pages and you want to change the font used to display the content. With the old methods you would have had to edit every one of those 50 files in order to change one or several lines of code specifying the font. With CSS you just need to alter one file, and the change will filter (or "cascade") through to every single web page. You should now be beginning to see the power of CSS, and how it can make our lives so much easier, as well as conforming to the latest standards.

This Guide will teach you how to use CSS to style your web pages. If you are feeling a bit apprehensive about learning it then don't be. There is a lot of unfounded nervousness surrounding CSS, but if you have already taught yourself HTML then you have nothing to fear - CSS is even easier to learn than, and at the same time it is potentially more enjoyable because you can really start bringing your web pages to life. So when you're ready, let's get going!