How to Create Navigation Links using HTML5 ?

In this article, we create a navigation link by using the <nav> tag in the document. The nav element represents a section of the page whose purpose is to provide navigational links, either in the current document or to other documents. The links in the “nav” element may point to other webpages or to different sections of the same webpage. It is a semantic element. Common examples of the “nav” elements are menus, tables, contents, and indexes.

Syntax:

<nav>
    Links...
</nav>

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to create navigation 
        links using HTML5 ?
    </title>
  
    <style>
        .gfg {
            font-size: 40px;
            color: #090;
            font-weight: bold;
            text-align: center;
        }
  
        .nav_tag {
            text-align: center;
            margin: 30px 0;
            font-size: 35px;
        }
    </style>
</head>
  
<body>
    <div class="gfg">
        GeeksforGeeks
    </div>
  
    <div class="nav_tag">
        How to create navigation 
        links using HTML5 ?
    </div>
      
    <nav>
        <a href="#">C++</a> |
        <a href="#">Java</a> |
        <a href="#">PHP</a> |
        <a href="#">Data Structure</a> |
        <a href="#">Algorithm</a>
    </nav>
</body>
  
</html>

chevron_right


Output:

Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.