HTML 5 will be completely formalized in 2014. However, current browsers already support its new features.
In the next sections of the article will be shown the changes in HTML 5 and examples.
Updating the Doctype
To make the transition to HTML 5 the first thing that should be considered is the top of the page. In HTML 4 had the following Doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
To migrate to the HTML 5 the change is simple, just change the Doctype for a much more simplified as can be seen below:
The old Doctypes were difficult to remember and usually what they did was copy and paste the Doctypes of one file to another. With this new Doctype is much easier to remember and more importantly, this Doctype will not be changed in future versions of HTML, making it the definitive and official documents to HTML. In the old patterns of HTML was used a DTD to know what it was about the document, HTML 5 now simplified and eased the process causing the browsers only recognize the document type as HTML Doctype in itself to ensure that it is reviewing an HTML document.
Updating Meta Tags
Another significant change in this where we had previously Meta Tags Meta tags as follows:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
In the update to HTML 5 also has a substantial simplification of Meta Tags getting from now as shown below:
All current browsers already support this Meta Tag much simpler and streamlined coding that highlights mainly excluding the former superfluous items.
The default UTF-8 is a character encoding that supports numerous alphabets. The UTF-8 is the newest coding standard.
Updating the Tag Link
Another novelty introduced in HTML 5 is the upgrade of the link tag that previously had the following syntax:
<link type="text/css" rel="stylesheet" href="lounge.css">
The new specification says should eliminate the Type attribute, because the type is the default CSS when not specify any kind. Therefore, the new syntax is as indicated below:
<link rel="stylesheet" href="lounge.css">
After the above modifications we have an update of any HTML document into HTML 5. Now our pages are ready to enjoy all that HTML 5 has to offer. If you already have familiarity with HTML 4.01 will be even more beneficial we use HTML 5 which is a superset of HTML 4.01, so using the HTML 4.01 and has extending its functionality. Obviously for us to use HTML 5 is not enough to update it some elements in reality this is a first step to begin to use everything that HTML 5 has to offer to create rich web applications.
Below is a simple example, but it demonstrates the elements upgraded to HTML 5:
Listing 1: Sample Web page in HTML 5.
<!doctype html> <html> <head> <title>HTML5 Example</title> <meta charset=“utf-8"> <link rel=“stylesheet" href=“css_exemplo.css"> <script src=“js_exemplo.js"></script> </head> <body> <h1>Welcome to our first HTML5 Example</h1> <p> <img src="img_exemplo.gif" alt="Exemplo Img"> </p> <p> This is a page example in HTML5. See more <a href=“http://www.w3c.org”>here<a/>. </p> </body> </html>
Other Information You Should Know
People still wonder what happened to that XHTML was considered the future of HTML. What basically happened is that strict, rigid led to the flexible, simple. So, fortunately for many XHTML and who was just in its place is the current HTML 5. However, if the developer already knows XHTML it becomes very important and useful for mastering HTML 5, so the knowledge is not lost.
Major companies such as Itaú, Submarino, Banco do Brazil, among other corporations have said already migrating to HTML 5. For these companies it represents various facilities to the reader and the consumer as clean code, to ease accessibility and possibility of introducing new technologies that can facilitate and streamline navigation.
I ask readers to keep sending emails (email@example.com) with their requests for new articles, this article is more a request of some readers who felt a bit sparse information about how to get an upgrade to the new standard and what are the main features of HTML 5. In the next article we will continue talking about HTML 5 emphasizing some news.