Horizontal Scroll Navigation Using HTML CSS
Horizontal Scroll Navigation Using HTML CSS
How we can create a scrolling navigation bar using HTML and CSS? Solution:
Horizontal Scroll Navigation Using HTML CSS, Scrolling Menu Bar.
Previously I have shared some types of Navbar, But this is different from others.
This menu has more content than its width, and all extra overflow materials are
hidden. We can access all the items by scrolling left or right, but I have disabled
the scrollbar. Now you can scroll using left and right arrow keys and in the phone,
you can slide easily.
Today you will learn to create a Horizontal Scrolling Menu Bar with Pure CSS &
HTML. In this menu, you have scroll left or right to see all the menu items. There are
no navigation buttons for PC users, they have to scroll by pressing buttons on
the keyboard. We also can add buttons but for that JavaScript is required, but I
want to create with Pure CSS.
So, Today I am sharing Horizontal Scroll Navigation Using HTML CSS. This
menu bar has a minimal design, some nav items with a fixed logo. You can use this
on your website after some customization. If you want then you can show the scroll
bar, I have hidden that element using CSS command.
If you are thinking now how this Scrolling Menu Bar actually is, then see
the preview given below.
Video Player
00:00
00:08
Live Demo
Now you can see this visually, there also a button above for seeing it live. If you like
this, then get the source code of its.
Create an HTML file named ‘index.html‘ and put these codes given here below.
1 <!DOCTYPE html>
2 <!--Code By Webdevtrick ( https://webdevtrick.com )-->
3 <html lang="en" >
4 <head>
5 <meta charset="UTF-8">
6 <title>Horizontal Scroll Nav | Webdevtrick.com</title>
7
8 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
9 <link rel="stylesheet" href="style.css">
10 </head>
11 <body>
12
13 <div class="container nav">
14 <div class="info">On desktop control with left and right keys</div>
15 <header class="nav-header">
16 <span class="logo"><img src="http://pngimg.com/uploads/google/google_PNG19644.png"></span>
17 <nav class="middle scroll">
18 <span class="item">Home</span>
19 <span class="item">About</span>
20 <span class="item">Portfolio</span>
21 <span class="item">Pricing</span>
22 <span class="item">Services</span>
23 <span class="item">Contact</span>
24 <span class="item">Blog</span>
25 <span class="item">Help</span>
26 </nav>
27 </header>
28 </div>
29
30 </body>
31 </html>
style.css
Now create a CSS file named ‘style.css‘ and put the codes given here.