HTML5 Markup - Why should we use HTML5?



HTML5 is a markup language used for structuring and presenting content on the World Wide Web. Its fifth version is the currently used stable version. You might have read about the HTML hierarchy in the previous article. This article will walk through the basic HTML5 code and explain the elements.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Creative Technocrayts/title>

<link rel="stylesheet" href="css/main.css" type="text/css" />

<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if lte IE 7]>
  <script src="js/IE8.js" type="text/javascript"></script><![endif]-->
<!--[if lt IE 7]>

  <link rel="stylesheet" type="text/css" media="all" href="css/ie6.css"/><![endif]-->
</head>

<body id="index" class="home">
</body>
</html>

The above code snippet forms the basic framework for any web page.


I.        <!DOCTYPE html>
Doctype is the document type specification put on the top of the html file to instruct the browser the way it should render the document. The statement attempts to render the document according to relevant specification instead of getting into quirks mode.
Quirks mode is a non standard mode every browser follows thereby making the browser render inconsistent across various browsers. The browsers attempts to render webpage in a backward compatible standard. Either in the absence of this specification or absence of the statement may make the web page render quirks mode in browser, web crawlers or screen readers.

Html for 4:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
HTML for 5:
<!DOCTYPE html>

II.        HTML tag
HTML is the root element of the web page document. All other elements must be a descendant of this document. (Refer)
III.        Head element
Head is the element which contains the description of the document called metadata. The head encloses information like title, keywords, author, viewport and styles.
The charset property felicitates support of backward compatibility with legacy browsers




IV.        Conditional comments
Conditional comments are added in a web page to support older versions of IE. The first comment is to solve backward compatible bugs for all versions of IE. The second one supports IE7 and below and CSS bugs. The third link resolves IE6 bugs.
V.        Body element
Body element encloses the actual content of the webpage and there can be only one body element


Comments

Popular posts from this blog

How to initialize Datatable plugin?

Datatables.net - Plugin options

What are some mistakes people make when they start learning HTML, CSS and JavaScript?