Skip to content
Related Articles

Related Articles

Foundation CSS Menu Icons

View Discussion
Improve Article
Save Article
  • Last Updated : 24 Mar, 2022
View Discussion
Improve Article
Save Article

Foundation CSS is an open-source and responsive front-end framework built by ZURB foundation in September 2011, that makes it easy to design beautiful responsive websites, apps, and emails that look amazing and can be accessible to any device. It is used by many companies such as Facebook, eBay, Mozilla, Adobe, and even Disney. The framework is built on Saas-like bootstrap. It is more sophisticated, flexible, and easily customizable. It also comes with CLI, so it’s easy to use it with module bundlers. It offers the Fastclick.js tool for faster rendering on mobile devices.

A menu in Foundation CSS is a navigation list that contains the different components that redirect to the various linked pages in the websites or web applications.

Icons we know are symbols with each carrying a special meaning and special purpose. An icon can be used in place of text.

Foundation CSS Menu Icons Classes:

  • menu: This class is used to create a navigation menu.
  • icons: This class specifies that the menu contains icons
  • icon-right: This class specifies that icon is right of the menu text.
  • icon-left: This class specifies that icon is left of the menu text.
  • icon-top: This class specifies that the icon is on top of the menu text.
  • icon-bottom: This class specifies that the icon is at the bottom of the menu text.
  • vertical: This class is used to create a vertically aligned menu.
  • nested: This class is used to create a nested menu.
  • fi-list: This class is used to create a list icon.
  • fi-minus: This class is used to create a minus icon.

Syntax:

<ul class="menu icons icon-top">
   <li><i class="fi-list"></i>....</li>
   ....
</ul>

Example 1: This is a basic example illustrating different directions of menu icons created using Foundation CSS.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <title>Foundation CSS Menu Icons</title>
    <!-- Compressed CSS -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
"//cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css" />
    <!-- Compressed JavaScript -->
    <script src=
    </script>
    <script src=
    </script>
  
    <style>
        body {
            margin-left: 10px;
            margin-right: 10px;
        }
    </style>
</head>
  
<body>
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
      
    <strong>Foundation CSS Menu Icons</strong>
    <br>
  
    <p>Icon Top</p>
    <ul class="menu icons icon-top">
        <li><a href="#"><i class="fi-list"></i>
                <span>Data Structures</span>
            </a>
        </li>
        <li><a href="#">
                <i class="fi-list"></i>
                <span>Algorithms</span>
            </a>
        </li>
        <li><a href="#">
                <i class="fi-list"></i>
                <span>Interview Preparation</span>
            </a>
        </li>
    </ul>
    <p>Icon Bottom</p>
    <ul class="menu icons icon-bottom">
        <li><a href="#">Data Structures
                <i class="fi-list"></i></a></li>
        <li><a href="#">Algorithms
                <i class="fi-list"></i></a></li>
        <li><a href="#">Interview Preparation
                <i class="fi-list"></i></a></li>
    </ul>
    <p>Icon Left</p>
    <ul class="menu icons icon-left">
        <li><a href="#">
                <i class="fi-minus"></i>
                <span>Data Structures</span></a>
        </li>
        <li><a href="#"><i class="fi-minus"> </i>
                <span>Algorithms</span></a></li>
        <li><a href="#"><i class="fi-minus"></i>
                <span>Interview Preparation</span></a>
        </li>
    </ul>
    <p>Icon Right</p>
    <ul class="menu icons icon-right">
        <li><a href="#"><span>Data Structures</span>
                <i class="fi-minus"></i></a></li>
        <li><a href="#"><span>Algorithms</span>
                <i class="fi-minus"></i></a></li>
        <li><a href="#"><span>Interview Preparation</span>
                <i class="fi-minus"></i></a></li>
    </ul>
  
    <script>
        $(document).foundation();
    </script>
</body>
  
</html>


Output:

Example 2: This is a basic example illustrating nested menu icons created using Foundation CSS.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <title>Foundation CSS Menu Icons</title>
    <!-- Compressed CSS -->
    <link rel="stylesheet" href=
    <link rel="stylesheet" href=
"//cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.min.css" />
    <!-- Compressed JavaScript -->
    <script src=
    </script>
    <script src=
    </script>
  
    <style>
        body {
            margin-left: 10px;
            margin-right: 10px;
        }
    </style>
</head>
  
<body>
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
      
    <strong>Foundation CSS Menu Icons</strong>
    <br>
  
    <ul class="menu vertical icons icon-top">
        <li><a href="#"><i class="fi-list"></i>
                <span>Data Structures</span></a></li>
        <ul class="nested vertical menu icons icon-right">
            <li><a href="#"><span>Linked List</span>
                    <i class="fi-minus"></i></a></li>
            <li><a href="#"><span>Stacks</span>
                    <i class="fi-minus"></i></a></li>
            <li><a href="#"><span>Queues</span>
                    <i class="fi-minus"></i></a></li>
        </ul>
        <li><a href="#"><i class="fi-list"></i>
                <span>Algorithms</span></a></li>
        <ul class="nested vertical menu icons icon-left">
            <li><a href="#"><i class="fi-minus"></i>
                    <span>Binary Search</span></a></li>
            <li><a href="#"><i class="fi-minus"></i>
                    <span>Merge Sort</span></a></li>
            <li><a href="#"><i class="fi-minus"></i>
                    <span>Dijkstra Algorithm</span></a></li>
        </ul>
        <li><a href="#"><i class="fi-list"></i>
                <span>Interview Preparation</span></a></li>
    </ul>
  
    <script>
        $(document).foundation();
    </script>
</body>
  
</html>


Output:

Reference: https://get.foundation/sites/docs/menu.html#icons


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!