Skip to main content

Chapter 7 : HTML 5 – Nav Element

 


HTML 5 – Nav Element

 

The <nav> HTML element represents a section of a page whose purpose is to provide  the navigational section in HTML documents. Websites typically have sections dedicated to navigational links, which enables users to navigate the site. These links can be placed inside a nav tag. Common examples of navigation sections are menus, tables of contents, and indexes.

These are the Following Uses of Nav Element

1.     Main use of <nav> in HTML 5 for creating navigations of websites

2.     We can use several <header> elements in one document.

3.     The <header> element is intended to usually contain the section’s heading h1 to h6

4.     The <header> element can also be used to wrap a section’s table of contents, a search form, or any relevant logos.

5.     The <header> tag is a HTML5’s tag and it requires a starting tag as well as an end tag.

 

 

Syntax

<nav class="nav-main">

  <ul>

    <li><a href="#">Home</a></li>

    <li><a href="#">About</a></li>

    <li><a href="#">Contact</a></li>

  </ul>

</nav>

 

Example

In this example, a <nav> block is used to contain an unordered list (<ul>) of links. With appropriate CSS, this can be presented as a sidebar, navigation bar, or drop-down menu.

<!DOCTYPE html>

<html>

<head>

            <meta charset="utf-8">

            <title>Example Header</title>

</head>

<body>

 

            <header>

                        <h1>LOGO NAME</h1>

                        <a href="">Home</a>

                        <a href="">About</a>

                        <a href="">Services</a>

                        <a href="">Contact</a>

            </header>

 

</body>

</html>

 

Result



 

 

Comments

Popular posts from this blog

Chapter 4 - HTML Basics

1.      HTML Documents   The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect. In HTML5, the <!DOCTYPE> declaration is very simple. We write as   <!DOCTYPE html> .   The HTML document itself begins with <html> and ends with </html> . The visible part of the HTML document is between <body> and </body> . 2.      HTML Language   <html lang="en"> attribute is used for declare the language of the Web pages 3.      This is the complete structure of HTML   <!DOCTYPE html> <html lang="en"> <! ---   for language ---> <head> <! --- we can write scripts here ---> <title>Page Title</title> </head>   <body>   <! --- we can write all the codes here ---> <h1>My First Heading</h1> <p>My first paragr...

Chapter 6 : HTML 5 – Header Element

  HTML 5 – Header Element   The <header> element is the block level element which I have discussed in my previous article for what is block level elements .   The <header> HTML 5 element represents introductory content, typically a group of introductory or navigational aids. It may contain some heading elements but also a logo, a search form, an author name, and other elements.   These are the Following Uses of Header Element The header tag contains information related to the title and heading of the related content.   Main use of <header> in HTML 5 for creating header of websites Design Logo, Navigations and Headings thorough header. We can use several <header> elements in one document. The <header> element is intended to usually contain the section’s heading h1 to h6 The <header> element can also be used to wrap a section’s table of contents, a search form, or any relevant logos. The <header> tag is...