Edit This Code:
<!DOCTYPE html>
<html>
<head>
<style>
ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 60px;
}


li a {
    display: block;
    background-color: #dddddd;
}

</style>
</head>
<body>

<ul>
  <li><a href="tryit.asp-filename=trycss_navbar_vertical2.html#home">Home</a></li>
  <li><a href="tryit.asp-filename=trycss_navbar_vertical2.html#news">News</a></li>
  <li><a href="tryit.asp-filename=trycss_navbar_vertical2.html#contact">Contact</a></li>
  <li><a href="tryit.asp-filename=trycss_navbar_vertical2.html#about">About</a></li>
</ul>

<p>A background color is added to the links to show the link area.</p>
<p>Notice that the whole link area is clickable, not just the text.</p>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy