Foundation - Vertical Menu



Description

The menu can be displayed vertically by using the class .vertical.

Example

The following example demonstrates the use of vertical menu in Foundation −

<!DOCTYPE html>
<html>
   <head>
      <title>Foundation Template</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/css/foundation.min.css" crossorigin="anonymous">

      <!-- Compressed JavaScript -->
      <script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/vendor/jquery.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/foundation-sites@6.5.1/dist/js/foundation.min.js" crossorigin="anonymous"></script>

   </head>

   <body>
      <h2>Example of Vertical Menu</h2>
      <ul class = "menu vertical">
         <li><a href = "#">Home</a></li>
         <li><a href = "#">About</a></li>
         <li><a href = "#">Service</a></li>
         <li><a href = "#">Contact</a></li>
      </ul>
   </body>
</html>

Output

Let us carry out the following steps to see how the above given code works −

  • Save the above given html code vertical_menu.htm file.

  • Open this HTML file in a browser, an output is displayed as shown below.

foundation_navigation.htm
Advertisements