HTML5 Main Structural Elements

1. <header>

The <header> element represents a group of introductory or navigational aids.

It may contain some heading elements and other elements like a logo, wrapped section's header, a search form and so on.

Example

<header>
<h1>Hello World </h1>
<p>Its time to start HTML5 </p>
</header>

2. <nav>

The <nav> element is intended only for a major block of navigation links.

So we can say that it represents a section of the document intended for navigation (like a menu).

Example

nav.html

<nav>
<ul>
<li><a href="index.html">Home</a></li>
</ul>
</nav>

index.html

<html>
<head>
My home page Abhi
</head>

<body>
<p>Try it at home</p>
<nav>
<ul>
<li><a href="nav.html" />Back</li></ul>
</nav>
</body>
</html>



3. <section>

It represents a generic document or application section. It can be used together with the h1, h2, h3, h4, h5, and h6 elements to indicate the document structure. (Just a logical grouping such as a contents section.)

Example

<html>

<body>

 

<section>

  <h1>Good Morning</h1>

  <p>

Hello world

 </p>

</section>

 

<section>

  <h1>Good Evening </h1>

  <p>

Bye Bye  World.</p>

</section>

 

</body>

</html>



4. <article>

It represents an independent piece of contents of a document, such as a blog entry or newspaper article.


Example

<html>

<body>

 

<article>

  <h1>HTML5 with Abhijeet</h1>

  <p>Today we will start HTML5  </p>

</article>

<article>

  <h1>HTML5 news part with Abhijeet</h1>

  <p>Great News for you..  </p>

</article>

 

</body>

</html>


5. <aside>


It represents a piece of content that is only slightly related to the rest of the page. (Usually a sidebar, but could be another type of content that isn't directly related to the main content.)

Example

<html>

    <head><title>HTML5 with Abhijeet</title>

    <style type="text/css"">

        aside

        {

       

            font-style:italic;

            color:cyan;

            float:right;

            width:80%;

            

        }

    </style>

    </head>

    <body>

        <div>

          <aside>Its raining...

        </aside>

        <p>Hello world</p>

        </div>

    </body>

</html>



6. <footer>

Represents a footer for a section and can contain information about the author and copyright information.

Example

<html>

<body>

 

<footer>

  <p>written by: Abhijeet Singh</p>

  <p>Contact information: <a href="mailto:[email protected]">[email protected]</a>.</p>

</footer>

 

</body>

</html>



Up Next
    Ebook Download
    View all
    Learn
    View all