Switching from good old HTML4 to the newer and better XHTML/CSS combo

These pages were written many years ago (2003 to 2006), and are still in most parts relevant, but especially when it comes to compatibility issues with different browsers, it's definitely not up-to-date anymore. Although I have to say, IE is still a pain in the butt.

Introduction

This guide is intended for people that know how to do plain simple HTML pages. Therefore I am not going to explain for instance what a <br> is, or how to put images in your page and all that. For real beginners I recommend basic HTML tutorials, like the one on W3C, or the many tutorials on the Webmonkey

The main difference

The main difference of the new combination of XHTML / CSS code to the old HTML pages is the differentiation of Content and Design. The actual Content (the information, be it textual or graphical) goes into the XHTML page (reminding us, that HTML actually meant Hypertext Markup Language) and the Design of that Content goes into the CSS code (the way the information gets presented).

In plain HTML code the design of the content was applied by using specific HTML tags (eg. <FONT> was heavily used to change the looks of the text, like color, size or style) or certain parameters of HTML tags (eg. <IMG SRC="picture.jpg" ALIGN="CENTER">).

That is not a problem when the pages are simple pages on a simple website. But it makes it pretty hard (if not impossible) to maintain a large site with dozens or hundreds of HTML pages or with extensive design. Imagine a change of look of the pages is necessary and one has to hunt through all the HTML pages to find all the little design-specific tags and parameters and has to change that!

To switch to the new ways of webpage programming, one has to strictly separate beween Design (CSS) and Content (HTML). It will help later on with changes of existing pages, and it will help with maintaining certain looks for specific elements. For example if the design of the different elements are all found in one place, one can be sure that all headlines look the same, all foot notes and so on. No need to double check if not on some pages the headlines are not in bold as intended or the wrong font gets used.