HTML Navigation Links

HTMLBeginner
Practice Now

Introduction

The HTML <nav> tag is an important element for creating navigation links on a website. In this lab, you will learn how to use the <nav> tag to create a navigation menu on your website.

Note: You can practice coding in index.html and learn How to Write HTML in Visual Studio Code. Please click on 'Go Live' in the bottom right corner to run the web service on port 8080. Then, you can refresh the Web 8080 Tab to preview the web page.

Creating a basic HTML page

First, let's create a new HTML page named index.html and add the basic HTML structure.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>My Website</title>
  </head>
  <body></body>
</html>

Now, let's create a navigation menu with the help of HTML <nav> tag. Create a <nav> element inside the <body> tag.

<body>
  <nav></nav>
</body>