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">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<body>

<nav class="w3-sidenav w3-light-grey w3-card-2" style="width:30%">
  <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Link 1</a>
  <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Link 2</a>
  <div class="w3-dropdown-hover">
    <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Dropdown <i class="fa fa-caret-down"></i></a>
    <div class="w3-dropdown-content w3-white w3-card-4">
      <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Link 1</a>
      <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Link 2</a>
      <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Link 3</a>
    </div>
  </div>
  <a href="tryit.asp-filename=tryw3css_ref_dropdown_menu3.html#">Link 3</a>
</nav>

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

<div class="w3-container">
  <p>In this example, we have added a dropdown menu inside the side navigation.</p>
  <p>Notice the caret-down icon, which we use to indicate that this is a dropdown menu.</p>
</div>

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


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