A Look Into HTML6 - What Is It, and What Does it Have to Offer?
Join the DZone community and get the full member experience.
Join For FreeHTML is a simple web development language that keeps on rolling out new versions, and has started working on its sixth revision. HTML5 the current revision of HTML is considered to be one of the most sought-after revisions, compared to all the previous HTML versions.
Let’s have an Overview of HTML5
HTML5 gave us some very exciting features like audio and video
support, offline local storage, and most importantly ability to build
mobile optimized websites. In addition, it gave us freedom from using
type attribute from tags such as <link>
and <script>
. What’s more? It helped developers organize content in a more relevant manner using new tags like <article>
, <section>
, <header>
etc. However, HTML5 is still in its development stage and isn’t a truly semantic markup.
Understanding the Concept of HTML6
Have you ever wondered if you could express tags? If you haven’t, then just imagine using tags like <logo></logo>
for assigning a logo to your web page, or using tag <toolbar<</toolbar>
and so on. Wouldn’t it be better if your could use the <div>
tag without using multiple id’s such as a wrapper or container, and rather use <wrapper>
or a <container>
directly. Simply put, instead of using <div id='container'>
you can simply use <container>
. This is where HTML6 comes in.
HTML6 is sixth revision of HTML with namespaces that has structure like XML. XML namespaces will help you use the same tag without conflicting it with any other tag. For instance the one used in the XHTML DOCTYPE:
xmlns:xhtml="http://www.w3.org/1999/xhtml"
HTML6 will provide us the benefit to use tags that we want and won’t have to use only the defined tags.
Example of HTML6
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> <html:meta type="title" value="Page Title"> <html:meta type="description" value="HTML example with namespaces"> <html:link src="css/mainfile.css" title="Styles" type="text/css"> <html:link src="js/mainfile.js" title="Script" type="text/javascript"> </html:head> <html:body> <header> <logo> <html:media type="image" src="images/xyz.png"> </logo> <nav> <html:a href="/img1">a1</a> <html:a href="/img2">a2</a> </nav> </header> <content> <article> <h1>Heading of main article</h1> <h2>Sub-heading of main article</h2> <p>[...]</p> <p>[...]</p> </article> <article> <h1>The concept of HTML6</h1> <h2>Understanding the basics</h2> <p>[...]</p> </article> </content> <footer> <copyright>This site is © to Anonymous 2014</copyright> </footer> </html:body> </html:html>
Looking at the above HTML6 document you’ll see some odd <html:x>
tags. Those odd tags are the namespaced elements that belong to the W3C
and HTML6 spec, and will trigger browser events. For example, the <html:title>
element will change the title bar of your browser and the <html:media>
element will help make the defined image appear on your browser screen.
The best part is that all these elements are specifically defined for
users and don’t have anything to do with the browser. They’re nothing
more than hooks for JavaScript and style sheet and helps to make your
sample code more semantic.
HTML6 APIs
The HTML6 tags will have the namespace html like <html:html>
or <html: head>
etc. Let’s have a look at the each tag attributes used in the above HTML6 example document.
1. <html:html>
<!DOCTYPE html> <html:html>// this is equivalent to <html> tag written in previous HTML versions <!-- sample of HTML document --> </html:html>
2. <html:head>
This tag is equivalent to <head>
tag. It’s purpose is to obtain data and scripts that tweaks how the content is displayed within the <html:body>
tag.
<!DOCTYPE html> <html:html> <html:head> <!-- Main content would come here, like the <html:title> tag --> </html:head> </html:html>
3. <html:title>
As the name implies, it will change the title of the HTML document, and is similar to the <title>
tag used in earlier HTML versions. This tag is used by browsers for changing the title bar, favorites, etc.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> </html:head> </html:html>
4. <html:meta>
This tag is somewhat different from the <meta>
tag
used in the latest HTML version. Using this HTML6 tag you can use any
sort of meta data. And so, unlike HTML5 you won’t have to use the
standard meta types in HTML6. It helps to accumulate information such as
a webpage description, by storing content.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> <html:meta type="description" value="HTML example with namespaces"> </html:head> </html:html>
5. <html:link>
This tag will help you link external documents and scripts (like CSS, JS etc.) to the HTML document. It’s similar to <link>
tag used in HTML5. This tag includes following attributes:
- charset: "UTF-8" character encoding.
- href: It contains link to your source file.
- media: This defines the kind of device on which your item will run, for example, "Smartphone" or "tablet".
- type: The MIME type of the document.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> <html:link src="js/mainfile.js" title="Script" type="text/javascript"> </html:head> </html:html>
6. <html:body>
This is just like the <body>
tag that you’ve been
using in the current HTML version. This is where all your website stuff
like text, media and others are placed.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> </html:head> <html:body> <!-- This is where your website content is placed --> </html:body> </html:html>
7. <html:a>
This tag is similar to the <a>
tag, and is used to represent a link to other web page. However, unlike the <a>
tag, <html:a>
takes only a single ‘href’ attribute, which directs the link to the page you need to visit.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> </html:head> <html:body> <html:a href="http://siteurl">Go to siteurl.com!</html:a> </html:body> </html:html>
8. <html:button>
This tag is equivalent to <button>
tag or <input type="button">
used in the current and older HTML versions. This tag enables you to
create a button to help a user perform some interaction on your site’s
page. It has one attribute disabled.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> </html:head> <html:body> <html:button>Click Here</html:button> </html:body> </html:html>
9. <html:media>
This tag wrap up all the <media>
tags like <img>
, <video>
, <embed>
, etc. By using <html:media>
tag, you no longer have to specify a tag for each of the file type. The <html:media>
tag you’re using will be executed by the browser based on the type
attribute (if provided), or it will just make a guess on the basis of
file extension, or by the ‘MIME type’.
<!DOCTYPE html> <html:html> <html:head> <html:title>A Look Into HTML6</html:title> </html:head> <html:body> <!-- Image would come here --> <html:media src="img1/logo.jpg" type="image"> <!-- Video doesn't need a type --> <html:media src="videos/slide.mov"> </html:body> </html:html>
An Overview of Tag types
Similar to the current and previous HTML versions, HTML6 will also have two types of tags such as single tags and double tags. The single tags won’t be having any text content, and rather will only have attributes. For example:
<html:meta type="author" content="z13a"> <html:meta type="author" content="z13a" />
Compared to the double tag, you don’t need to close your single tag. Double tags have opening and closing tag, as they have some text content. But, in the case double tags don’t have any text based content, you can reduce it to the ‘self-closing single variant’. For example:
<html:link href="./a.html">Text based content</html:link> <!-- This shortand... --> <foo class="xyz" /> <!-- ...means in fact this: --> <foo class="xyz"></foo>
Conclusion
HTML6 isn’t here yet. But an idea of what it will be offering has been provided by Oscar Godson. This post will help you provide an overview of some of the basic concepts of HTML6.
Published at DZone with permission of Andrey Prikaznov, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments