![]() |
VOOZH | about |
We come across horizontal menus on almost every website. Pure CSS helps us implement such menus with ease by using the pure-menu class. Pure-menu class by default creates a vertical menu which we can simply convert into a horizontal one by adding the class pure-menu-horizontal. One of the most common uses of a horizontal menu is in navigation bars (navbars).
We will use the following classes to help us achieve the goal at hand:
Syntax:
<div class="pure-menu pure-menu-horizontal"> <ul class="pure-menu-list"> <li class="pure-menu-heading">...</li> <li class="pure-menu-item"> <a href="#" class="pure-menu-link"> ... </a> </li> </ul> </div>
Note: Do not forget to add the pure CSS CDN to be able to use the pure CSS framework
Example: Let us suppose we want to create a horizontal menu for the nav bar of our portfolio.
Output: