The Basics

It is becoming very common to see questions from people who are trying to build web pages using HTML 5 and CSS 3 who seem to not properly understand what those are. The way they ask their question seems to imply that they think that these are completely new markup languages with no connection to what came before.

In the case of CSS 3 there are a number of modules that make up the language. This approach makes amending the language easier as functionality can be amended by amending just the one module and new functionality can be added by adding a new module. Many of these modules are in fact exactly the same as they were in CSS 2.1 as very little of the basic functionality required of CSS has needed to be changed. In fact some of that code is still as originally defined for CSS 1.

So as regards to CSS, anyone who has valid CSS has valid CSS 3 whether their CSS includes those commands that were on;y added in a CSS 3 specific module or not. In fact the standards now give version numbers to the individual modules rather than to CSS in its entirety and so the CSS modules actually introduced in what people call CSS 3 are actually version 1 of those modules.

HTML 5 (if we disregard all the marketing hype that used the term to refer to things that have nothing to do with HTML) can be considered to consist of three parts. The largest part of HTML 5 is in fact HTML 4.01 strict. The second part is a number of new tags and attributes that were added to provide functionality that either wasn't required at the time HTML 4 was released or which has subsequently been found to be useful. The third part is really only for those creating browsers and is basically an instruction to not delete all of the commands that were flagged for removal from HTML with version 5 because too many sites completely ignored that they were supposed to be removed and have continued using them. Had all of the commands that HTML 4 flagged for removal in HTML 5 actually been removed then it would have broken the over 90% of the web that has yet to upgrade from HTML 3.2.

The people wanting HTML 5 and CSS 3 web sites who ask for help appear to be totally ignoring that these are built on the prior versions and that apart from a few relatively minor additions the markup is unchanged from the prior version. Amazingly they mostly have invalid HTML as their starting point and are asking for help because the CSS doesn't work. Well of course it doesn't work because their HTML is invalid.

What these people are forgetting is the basics. HTML 5 is still HTML and CSS 3 is still CSS. In both cases the code needs to be valid for it to work properly across all browsers. While the W3C HTML 5 validator is not as useful as the one for HTML 4 (as it happily accepts those obsolete tags that were flagged for removal in HTML 4 and which would have been removed by now if people had upgraded from HTML 3.2 to HTML 4) it is still better to run all your pages through it than not. If you want to make sure that your page is truly HTML 5 and not just HTML 3.2 with a few extra tags then run the page through the HTML 4 and 3.2 versions of the validator as well. If your page is truly valid then the HTML 5 validator will show no errors and the HTML 4 and HTML 3.2 validators will show identical errors. Well at least you'd be close to having the HTML coded correctly in that situation.

Running validation on the CSS is easier because they haven't reintroduced obsolete code there in order to apply backward support as the current approach to stylesheets was introduced after HTML 4 and so people can't use an HTML 3.2 equivalent.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow