Menu
How TO – Bottom Navigation
Learn how to create a bottom navigation menu with CSS.
Bottom Navigation Menu
Home
News
Contact
Bottom Navigation Bar
Some text some text some text.
Try it Yourself
<!DOCTYPE html>
<html>
<head>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.navbar {
overflow: hidden;
background-color: #333;
position: fixed;
bottom: 0;
width: 100%;
}
.navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.navbar a:hover {
background: #f1f1f1;
color: black;
}
.navbar a.active {
background-color: #04AA6D;
color: white;
}
.main {
padding: 16px;
margin-bottom: 30px;
}
</style>
</head>
<body>
<div>
<a href=”#home”>Home</a>
<a href=”#news”>News</a>
<a href=”#contact”>Contact</a>
</div>
<div>
<h1>Bottom Navigation Bar</h1>
<p>Some text some text some text.</p>
</div>
</body>
</html>
Create A Bottom Navigation Menu
Step 1) Add HTML:
Example
<div class=”navbar”>
<a href=”#home” class=”active”>Home</a>
<a href=”#news”>News</a>
<a href=”#contact”>Contact</a>
</div>
Step 2) Add CSS:
Example
<!DOCTYPE html>
<html>
<head>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.navbar {
overflow: hidden;
background-color: #333;
position: fixed;
bottom: 0;
width: 100%;
}
.navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.navbar a:hover {
background: #f1f1f1;
color: black;
}
.navbar a.active {
background-color: #04AA6D;
color: white;
}
.main {
padding: 16px;
margin-bottom: 30px;
}
</style>
</head>
<body>
<div>
<a href=”#home”>Home</a>
<a href=”#news”>News</a>
<a href=”#contact”>Contact</a>
</div>
<div>
<h1>Bottom Navigation Bar</h1>
<p>Some text some text some text.</p>
</div>
</body>
</html>