What is a Menu?
A menu on a webpage is a collection of links that allows users to navigate to different locations within a website.
Typically, it is found at the top of the webpage and can direct users to different pages or different sections within the same page.
Menu Example Code - html
<!-- Navbar links -->
<ul class="nav-menu">
<li><a class="nav-link" href="#about">About</a></li>
<li><a class="nav-link" href="#interests">Interests</a></li>
<li><a class="nav-link" href="#memory">Memories</a></li>
</ul>
Menu Example Code - css
.navbar .nav-menu {
display: flex;
align-items: center;
background: white;
}
.navbar .nav-link {
margin: 0 16px;
font-size: 14px;
font-weight: var(--weight-semibold);
}
Creating the Menu List
Creating the Menu List
<ul class="nav-menu">
...
</ul>
First, let's create the menu list.
A menu list is created using the <ul>
tag. The <ul>
tag is used to define an unordered list.
A similar tag is the <ol>
tag.
The <ol>
tag is similar to the <ul>
tag but is used to define an ordered list.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.