PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

11.12.: Migrate to html5!

Note: This article was originally published at Planet PHP on 18 April 7480.
Planet PHP
html5 is one of the hottest buzzwords in the web and everyone is using or talking about it. Google is ahead everyone else for sure with Google Docs, their web based office suite and with Chrome OS, an operating system which only needs a browser (from the userA's view). But also Facebook, they working on their own application platform codenamed ASpartacusA" is based on html5. Even classic software companies like Adobe and Microsoft are joining the competition: Microsofts upcoming WIndows 8 operating system will include small html5 based apps (another buzzword) and Adobe has a double-tracked strategy: they release new html5 development tools almost every month and they still try to rescue their old, main product, Flash.

html5 became reality due to the real life challenges in the last 10 years when Microsoft decided to stop their future browser development after releasing the Microsoft Internet Explorer 6 back in 2001. But in the same time more and more business critical applications moved from desktop apps into the web and the World Wide Web Consortium (W3C) wanted to push the web into a XML based world with their Xhtml 2.0 draft standard. Today we know it was good everyone ignored the Xhtml 2.0 development. Because of this, companies like Google, Mozilla, Apple and Opera started a project called Web Hypertext Application Technology Working Group (WHAT WG) to create an evolutionary path for html and the web.

While Microsoft was working on their Windows Vista disaster, the members of the WHAT WG worked on a draft for the so called html5 based on html 4.01 and they added new features into their browsers. The development was based upon the challenges for things like Google Mail (2005) or AWeb Apps for iPhoneA" (2007) and many web developers canA't wait for these new features and then even Microsoft and the W3C couldnA't refuse to see the reality. Nowadays Xhtml 2.0 is gone and even Microsoft is working on a browser called Windows Internet Explorer 10 without any plugin interface, without crappy conditional comments and almost full html5 support.

The question for web developers is wether we already should use html5 in our web applications. html5 is for all of us who want to push their documents to online apps and donA't want to use plugins or hacks. The update from your html 4.01 or Xhtml 1.0 markup is quite easy.

html5 revised

The first and even most simple modification of html5 compare to html 4.01 or Xhtml 1.0 is the document type, which changed from



to



As you can see immediately the version number is missing. The WHAT working group even calls the html5 specification now Ahtml living standardA" and there are updates in the specification almost every week. This shouldnA't be a problem for anyone because all modern browser like Firefox, Chrome, Safari, Opera and even Internet Explorer 10 are using their html5 rendering engine if the html5 document type is parsed.

Another goal during the html5 draft was a cleanup and removal of obsolete and bad defined elements in html 4.01 and Xhtml 1.0. html5 should have been much more simpler and all redundant elements should be removed. Tags likeA,,, and are not part of the spec anymore. As you can see with the removal of the last two elements itA's not possible to build frame based web pages with html5. html5 also requires to use Cascading Style Sheets (CSS) for the representation of web pages, all elements and attributes for styling content were also removed. This removal includes attributes like plaintext, isindex, align, alink, vlink and html tags like,,,,,,, .

html5 improvements

There are a lot of small improvements to solve daily web development problems. Embedded images now have a border with 0 pixels instead an ugly blue border by default and the tag now assumes to have JavaScript included. If you add links or images to your webpage, please use the AidA" attribute instead AnameA" because itA's much easier for DOM manipulations. One really great improvement is the character set declaration. Instead of adding



you only need this:



And, please only us

Truncated by Planet PHP, read more at the original (another 4256 bytes)