So is it safe to build in HTML5 already?


I won’t consider HTML5 a viable markup language until

[list=1][]it is an official recommendation and
]it is supported natively by all major browsers (to me, that means at least 95 percent of the browser market)[/list]
My guess is that this will happen between 2015 and 2020.

Define safe.

HTML5 isn’t a finished recommendation yet, which means it doesn’t exist. You can’t write anything that is HTML5. You can write something that adheres to the current draft, which may be invalid a couple of hours from now.

For a more pragmatic reply: you can use some of the new element types that may become part of HTML5 eventually and that are currently implemented in some fashion in certain browsers. As long as you don’t rely on those features, since far from every browser implements them.

Normal progressive enhancement in other words. With the added risk that your code may be non-compliant and stop working tomorrow or next year.

Tommy: that was basically the idea - using some elements of HTML5 that wouldn’t “break” when rendered in current browsers (e.g. <nav>).

Well older browsers won’t recognise a NAV element as it wasn’t an existing element at the time - unfortunately some browsers like IE won’t recognise or use elements unless their defined in the browser, rather than simply accepting them even though their considered wrong. I’ve seen three implementations to make them become noticed, one is using JavaScript (not too graceful) the other uses conditional comments to offer two sets of opening and closing tags (one HTML4 and one HTML5) - or the same thing done with server-side scripting (much better if you can do it) - it is possible to accomplish (in essence) but it requires more code bloating, and you’re going to have to maintain your code every time they make a change to the draft - which is time consuming and frustrating. :slight_smile:

I suppose it really depends upon whether you intend on publishing it in the public domain or not. But like was said it is in a constant state of flux and non-normative and only has “patchy support” for specific parts. So I think the consensus is; it’s basically not really ready or practical to use.

If you are writing experimental pages to “test” the proposals to see if they are appropriate for the standard then that should be safe enough since the pages will obviously be intended to be reworked at intervals as the proposal changes based on how it does/doesn’t work out.

For mainstream web pages you should be using HTML 4 which is the current standard and will be for many years to come (although the vast majority of web pages are still in the process of slowly upgrading from HTML 3.2 and there will probably still be many pages using HTML 3.2 in 20 years time).

HTML5 is safe to use provided that you don’t use any HTML5-only elements :smiley: