How to create: horizontal scrollable menu
- Previous page Sidebar with icons
- Next page Vertical menu
Learn how to use CSS to create a horizontal scrollable menu.
How to create a horizontal scrollable menu
Step 1 - Add HTML:
<div class="scrollmenu"> <a href="#home">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> <a href="#about">About</a> ... </div>
Step 2 - Add CSS:
The trick to making the navigation bar scrollable is to use overflow:auto and white-space:nowrap:
div.scrollmenu { background-color: #333; overflow: auto; white-space: nowrap; } div.scrollmenu a { display: inline-block; color: white; text-align: center; padding: 14px; text-decoration: none; } div.scrollmenu a:hover { background-color: #777; }
Related pages
Tutorial:CSS navigation bar
- Previous page Sidebar with icons
- Next page Vertical menu