I am trying to design a new web page. I am thinking of using HTML 5 so that my page is up-to-date with web standards; I’m not aiming to make it too complex or flashy. However, it seems that not all the HTML 5 tags are supported in all browsers. Should I still go for it or should I stick to HTML 4 or XHTML 1.0 for now?
There isn’t even an HTML 5 standard yet for all browsers to support.
HTML 5 is still a draft and browsers are supporting various of the proposed features so that they can be tested to see if they will work as presented or need to be altered. Based on what has happened with prior versions HTML 5 will probably be significantly different to the way it is now by the time it becomes a standard.
If you decide to implement any of the HTML 5 draft features then you need to be prepared to update the way your page is coded if there are any changes made to the draft. Of course that may mean that you have to choose an appropriate time based on how many of your visitors use which browser and how quickly each browser adopts the change to the standards.
After all, people are still complaining about all the problems caused by people starting to use the draft version of CSS2 that was implemented in Internet Explorer 5 and which differed significantly from the final standard. It is that draft version that is usually what is meant when people refer to quirks mode and the lack of support for standards in IE. The problem was too many people started using the draft before it was altered to what eventually became the standard.
I am thinking of using HTML 5 so that my page is up-to-date with web standards;
What you do not have to worry about is that HTML5 is replacing HTML4… it’s updating it more than anything.
There are some small things you can do that will work in all browsers, such as the shortened doctype
<!doctype html>
and shortened meta tags, leaving off types from style and script tags, that sort of thing. The W3C HTML validator will call you on those things, but if you knew it was ok in HTML5 you can ignore those warnings, or use the http://html5.validator.nu validator.
Beyond that, any of the new block element tags require Javascript for Internet Explorer to render/style correctly, and this includes IE8. This means you are requiring scripting simply to make a user agent be able to read the markup (now any HTML4/XHTML1 tags inside those new HTML5 tags would be readable and styleable by IE; it will just completely ignore the new tags), which may not be acceptable to you. Even when HTML5 gets out of draft, this will be an issue: IE9 is planning on supporting much of HTML5 but currently (unless I missed a memo) it will not be available for Windows XP. I expect a large number of Windows users will not upgrade from XP if they don’t have to and will continue then with IE8 as their last-updated IE browser. It doesn’t matter that they should have the choice of using some other browser: there are many reasons why people use IE, and it may be corporate policy in many places anyway.
You may be able to get away with using some of the newer form control tags (with the <!doctype html> doctype), since most of those degrade to type=“text” controls in browsers who don’t support them, including IE. So today you may be able to enhance a bit of functionality for bleeding-edge browsers and iPhone users with form controls without straying into the “needs scripting to read markup” area.
If you are using ARIA attributes then I would stay away from HTML5 entirely (except, again, the doctype) as ARIA that works fine in HTML4/XHTML is having sometimes some big problems when used with HTML5. These problems are on both the browser vendor side and the Accessibility Technology side, so those will need to take time to get fixed, and then for users to upgrade if they can.
Stick with a normative markup language as was mentioned. Just because something looks new and gets hyped-up by moronic marketers and greedy book sellers doesn’t mean it will be of any more practical use to you. Than lets say good semantic markup provided by HTML 4.01 or XHTML 1.0, which both are considered normative.
All right. Guess I’ll be sticking to XHTML and HTML 4 then. Thanks for the advice.
I’d just stick to HTML. XHTML is effectively a myth since, if served under correct headers (application-xml/xthml) Internet Explorer 8 or earlier won’t parse it. I think IE 9 will, but I don’t know for sure.
And no, serving xhtml files under text/html is not technically correct even if you use the meta tag to redeclare the doc type in file. The reason is by the time the meta tag has been reached the browser has already chosen rendering engine and mode (most likely quirks mode) and its too late to undo the choice.
There are many other reasons in this vein - do some research on them. In my opinion HTML 4.1 Strict is the current gold standard to write and validate to insofar as the amount of content flexibility it provides. HTML 5 is still a while off, if it ever takes off now (The more the W3C does stupid things, the more I doubt it. From the outside looking in the organization looks more likely to implode than ever before).