If we want to represent the same thing in HTML 4 with proper names of the HTML section, we would probably use a DIV tag.
But in HTML 5 they have made it clearer by creating element names for those sections, which makes their HTML more readable.
Below the details of the HTML 5 elements which form the page structure.
- <header>: Represents header data of HTML.
- <footer>: Footer section of the page.
- <nav>: Navigation elements in the page.
- <article>: Self-contained content.
- <section>: Used inside article to define sections or group content in to sections.
- <aside>: Represent side bar contents of a page.
What is HTML5?
In this article HTML 5 of the hypertext markup language (HTML5) is a markup language for the structure and presentation of World Wide Web (www) content. HTML5 supports traditional HTML and XHTML style syntax and other new features in its markup, New APIs, XHTML and error handling.
The new HTML5 features include:
- New analysis rules that are not based on SGML but are geared towards flexible analysis and compatibility.
- Support for online scalar vector graphics (SVG) and mathematical markup language (MathML) in text / html.
- The new elements available include article, apart, audio, bdi, canvas, command, datalist, details, embedding, figcaption, figure, footer, header, hgroup, keygen, mark, meter, nav, output, progress, rp, rt , ruby, section, source, summary, time, video and wbr.
- The new available types of form controls include dates and times, email, url, search, number, range, phone and color.
- New attributes available from charset in meta and async in script.
- Global attributes that can be applied for each element that includes id, tabindex, hidden, data- * or customer data attributes.
Syntax of Doctype:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My paragraph.</p> </body> </html>
Description of the HTML example …
<!doctype>: defines the type of document or instructs the browser about the HTML version.
<html>: This tag informs the browser that it is an HTML document. The text between the html tag describes the web document. It is a container for all other HTML elements except
<head>: must be the first element within the element, which contains the metadata (information about the document). It must be closed before the body tag is opened.
<title>: As the name suggests, it is used to add the title of that HTML page that appears at the top of the browser window. It must be placed inside the head tag and must be closed immediately. (Optional)
<body>: The text between the body tag describes the body content of the page that is visible to the end user. This tag contains the main content of the HTML document.
<h1>: The text between the <h1> tag describes the first level header of the web page.
<p>: The text between the <p> tag describes the paragraph on the web page.>