Leveraging HTML6 features for enhanced web development

After having received a remarkable response for its already released versions, HTML is all geared up to woo the web developers via its sixth version. If you are an avid fan of HTML and want to dig deep into the features of HTML6, then this is a tutorial just for you. Here, I’ll be talking about HTML6 and the way it is being utilized for developing high-end web solutions.

A glimpse at HTML5

Not a real semantic markup, HTML5 indeed offers brilliant features including offline local storage, audio and video support and the flexibility to build mobile optimized websites etc. Backed by interesting tags including <nav>, <header>, <footer>, <article> and <section>, HTML5 still has some loopholes that need to be filled up for boosting success rate of web projects. Thanks to HTML6, we’ll be able to use any tag without being restricted to use only the defined tags. Read on to find more on this sixth revision of HTML.

HTML6- What is the basic concept?

Talking conceptually, HTML6 is a revised version of HTML that includes namespaces with an XML structure. The basic purpose of namespaces is to offer you an ease of using the same tag without worrying about its conflict with any other tag. Here’s a look at an example of HTML6:html6

<!DOCTYPE html>
<html:html>
<html:head>
<html:title>Leveraging HTML6 Features for enhanced web development</html:title>
<html:meta type=”title” value=”Page Name”>
<html:meta type=”description” value=”HTML document containing namespaced elements”>
<html:link src=”css/corefile.css” title=”Styles” type=”text/css”>
<html:link src=”js/corefile.js” title=”Script” type=”text/javascript”>
</html:head>
<html:body>
<header>
<logo>
<html:media type=”image” src=”picture/abc.png”>
</logo>
<nav>
<html:a href=”/pic1″>a1</a>
<html:a href=”/pic2″>a2</a>
</nav>
</header>
<content>
<article>
<h1>Main article heading</h1>
<h2>Main article sub-heading</h2>
<p>[…]</p>
<p>[…]</p>
</article>
<article>
<h1>HTML6 development concept</h1>
<h2>Understanding HTML6 Basics and Best Practices</h2>
<p>[…]</p>
</article>
</content>
<footer>
<copyright>This website is &copy; to Anonymous 2014</copyright>
</footer>
</html:body>
</html:html>

If you carefully observe the above code, you’ll find some odd <html:x> tags which are actually namespaced elements belonging to W3C and HTML6 spec. All the elements would trigger browser events. For instance, the <html : media> element will display the defined image on the browser screen. One of the greatest advantages of namespaced elements is that they are specifically designed for users and not browsers. Therefore, you can use them effectively for making the sample code more readable, something that wasn’t much feasible in HTML5.

HTML6 APIs- Get to know them before indulging in HTML6 web development

All the tags included in HTML6 will have a namespace html like <html : head>. Here is the list of tag attributes that have been used in the above example for HTML6:

  1. <html:html>
    <!DOCTYPE html>
    <html:html>// this is exactly similar to <html> tag used in all previous HTML versions
    <!– sample of HTML document –>
    </html:html>
  1. <html:head>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <!– Here, you can add site’s main content, for example<html:title> tag –>
    </html:head>
    </html:html>

The main purpose of <head> tag is to fetch data and scripts that can be used for moderating the way content is displayed within <html :body> tag.

  1. <html: title>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leveraging HTML6 features for enhanced web development</html:title>
    </html:head>
    </html:html>

The purpose of using <html: title> tag is to change the title of the HTML document. Aldo, this tag is absolutely similar to the <title> tag used in previous versions of HTML.

  1. <html:meta>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leverage HTML6 features for enhanced web development</html:title>
    <html:meta type=”description” value=”HTML document containing namespaced elements”>
    </html:head>
    </html:html>

A bit different from the traditional <meta> tag, the <html:meta> tag allows you to use any type of meta data.

  1. <html:link>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leverage HTML6 Features for enhanced web development</html:title>
    <html:link src=”js/corefile.js” title=”Script” type=”text/javascript”>
    </html:head>
    </html:html>

The <html:link> tag will enable yu to link all external documents and scripts such as JS, CSS etc, to the HTML document under focus.  Quite similar to the traditional <link> tag, <html:link> tag includes the following attributes:

  • href- this includes the link to the source file
  • type- this is the MIME Type of the HTML document
  • charset: this represents the UTF-8 character encoding
  • medi- this represents the type of device on which the item will run, for example, a tablet or a smartphones.
  1. <html:a>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leverage HTML6 features for enhanced web development</html:title>
    </html:head>
    <html:body>
    <html:a href=”http://siteaddress”>Go to siteaddress.com!</html:a>
    </html:body>
    </html:html>

Similar to the traditional <a> tag, <html:a> tag is used for representing a link to a different web page. A key difference between the traditional and contemporary <a> tag is that the latter one uses a single ‘href’ attribute for directing the link to the page that the user wants to visit.

  1. <html:media>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leverage HTML6 features for enhanced web development</html:title>
    </html:head>
    <html:body>
    <!– Image would come here –>
    <html:media src=”pic1/logo.jpg” type=”image”>
    <!– Video doesn’t need a type –>
    <html:media src=”video1/slide.mov”>
    </html:body>
    </html:html>

The main purpose of using this tag is to wrap up all the <media> tags including >img>, <embed>, <video> etc. Unlike the case of HTML5 where you were required to specify a tag for each individual media file, HTML6 offers you the convenience of using <html:media> tag which will be automatically executed by the browser on the basis of type attribute. Moreover, if the attribute is missing, the browser would choose a random tag in accordance to the file extension or the ‘MIME’ type.

  1. <html:body>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leverage HTML6 features for enhanced web development</html:title>
    </html:head>
    <html:body>
    <!– Here, you can add your site’s content –>
    </html:body>
    </html:html>

The <html:body> tag is exactly similar to the <body> tag that is being used I all previous versions of HTML. This Is the tag that holds all your website text, media etc.

  1. <html:button>
    <!DOCTYPE html>
    <html:html>
    <html:head>
    <html:title>Leverage HTML6 features for enhanced web development</html:title>
    </html:head>
    <html:body>
    <html:button>Click Now</html:button>
    </html:body>
    </html:html>

Similar to the traditional <button> tag, the <html:button> tag allows you to create a button, enabling the end user to perform a specific activity on your web page.

A brief on HTML6 Tag Types

Just like all the previous versions of HTML, even HTML6 will have two types of tags viz: single tags and double tags. Let’s take one each tag type individually:

  • Single tags– There are the tags which just contain the attributes and no text content. You need not close single tags. Here is an example:

<html:meta type=”editor” content=”r78t”>
<html:meta type=”editor” content=”r78t” />

  • Double tags–  These tags may or may not have a text context. If they have, then you can include an opening and closing tag or else if there’s no text content then you can easily reduce the tag to a ‘self-closing single variant’. Here is an example:

<html:link href=”./a.html”>Text based content</html:link>
<!– My story… –>
<foo class=”abc” />
<!– …has some interesting turns like: –>
<foo class=”abc”></foo>

Final Thoughts

Having inspired from the already popular AngularJS framework, HTML6 will be released with innovative features that would amazingly cut down the overall development time. However, it will be interesting to see how newbie web developers embrace this improved version of HTML.

Author Bio – Being a well-known blogger from Markupcloud Ltd., Mike gives valuable and best tips on context of  PSD to WordPress theme conversion and design technique. Also, he is enthusiast of sharing his innovative ideas related to web design technologies.