HTML 5 and Choice

The introduction of HTML 5 acknowledges that not everyone wants to do their web markup the same way. HTML 5 allows for both those who want to use the approach first introduced in HTML 4 with the addition of the extra tags needed by the modern web and it also allows those who still write their web pages using HTML 3.2 to continue to do so by not removing those obsolete tags flagged as deprecated in HTML 4 that in 1997 were expected to be removed in HTML 5 and also introduces a couple of proprietary tags that are still popular that HTML 4 had introduced replacements for.

So there are two approaches you can take with HTML 5. For the vast majority who have always used HTML 3.2 (usually with a doctype indicating that they are still in the process of transitioning to HTML 4 but have not done so yet) can continue to use their HTML 3.2 tags which HTML 5 has now reinstated for them as well as the new tags that they need for the modern web. The minority who actually liked the HTML 4 approach can now actually use HTML 4 (as the now dead IE7 browser was the last to not fully support it) again with the extra tags that they need for the modern web. There is even the option of switching to XHTML 5 once you decide you no longer need to support IE users (since IE8 and earlier offer XHTML for download instead of displaying it in the browser).

Let's look at a couple of examples of how HTML 5 code will look depending on whether you are using HTML 5/3.2 or HTML 5/4.

YouTube takes the HTML 5/3.2 approach to the code it uses for displaying videos. To cater for the changing need for different format videos for different browsers and the declining need for a flash fallback, YouTube decided to take control themselves of the HTML that is used for displaying their videos. So instead of having to hard code the video tag in your web page yourself (with the appropriate formats and fallback) they do the HTML 5 part of the code for you and simply provide a web page that displays the video for you to include into your page. For the purpose of attaching their page into yours they provide the following HTML 3.2 code (now reinstated into HTML so that those who prefer 3.2 can continue to use it):

<iframe width="640" height="390" src="" frameborder="0" allowfullscreen></iframe>

For those who prefer HTML 4 to HTML 3.2 it is a simple matter to make the slight changes to the provided code to get rid of the HTML 3.2 iframe tag and replace it with the HTML 4 object tag. Doing so has no effect whatever on the HTML 5 that determines which version of the video is displayed - all you are doing is switching between the 3.2 way of embedding web pages in other web pages and the 4 way of doing the same thing. Both ways are valid in HTML 5.

<object style="width:640px;height:390px;" type="text/html" data="" allowfullscreen></object>

Another example also involving video is where you want to display video that you have posted on facebook on another web page. Now from the code I found for this it appears that Facebook only supports flash for video still and does not yet support the HTML 5 video tag (this may have changed by the time you read this but that doesn't matter because in that case the code we are discussing would become the flash fallback part of the code. Now for some reason the page where I found this code had the HTML 3.2 version of the code nested inside the HTML 4 version as a fallback for when the HTML 4 version doesn't work. Since the browsers in which the HTML 4 version doesn't work are long dead this is unnecessary.

For embedding a flash video in your web page you can either use the HTML 5/3.2 approach:

<embed src="" type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="400" height="224"></embed>

or you can use the HTML 5/4 approach:

<object style="width:400px;height:224px;">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="movie" value="">

So as you can see, HTML 5 allows you a freedom to choose which approach to HTML that you prefer - the HTML 3.2 version introduced in January 1997 or the HTML 4 version introduced in December 1997 that was intended to replace it.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow