Edit This Code:
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../lib/w3.css">
<body>

<nav class="w3-sidenav w3-light-grey" style="width:25%">
  <a class="w3-green" href="tryit.asp-filename=tryw3css_sidenav_color.html#">Link 1</a>
  <a href="tryit.asp-filename=tryw3css_sidenav_color.html#">Link 2</a>
  <a href="tryit.asp-filename=tryw3css_sidenav_color.html#">Link 3</a>
  <a href="tryit.asp-filename=tryw3css_sidenav_color.html#">Link 4</a>
  <a href="tryit.asp-filename=tryw3css_sidenav_color.html#">Link 5</a>
</nav>

<div style="margin-left:25%">

<header class="w3-container w3-dark-grey">
  <h1>My Header</h1>
</header>

<div class="w3-container">
  <p>Use the w3-color class to change the background color of the side navigation.</p>
  <p>If you want an active/current link, to let the user know which page he/she is on, add the w3-color class to one of the links as well.</p>
</div>

</div>
      
</body>
</html>


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