Hello developers, today in this blog, you'll learn to create a Full-Screen Navigation Bar using HTML, CSS & JavaScript.
The navigation bar is a user interface element within a webpage that contains links to other sections of the webpage. This means that no matter what page you are viewing, you can use the navigation bar to visit other sections of the website.
In this blog(Full Screen Navigation Bar), there is a webpage with a navigation bar. The Full-Screen Navigation Bar consists of the image with a navigation bar that occupies the full screen of the webpage. The Navigation bar is the link that will redirect to the respective page. There is also a close button, where you can close the navigation bar. The navigation bars are like Home, Services, Products, Contacts, and so on.
The navigation bar is made to be fixed. When you hover over the navigation bar it will toggle the bar. JavaScript code has been used to show the active and the hover menu highlighted in the navigation bar.
The source code of this Full-Screen Navigation Bar is given below, if you want the source code of this program, you can copy it. You can use this Full-Screen Navigation Bar on your project.
Full-Screen Navigation Bar [Source Code]
To make this website, you would like to make three files: an HTML file, a CSS file & a JavaScript file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.
*{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body {
min-height: 100vh;
background-color: #21D4FD;
background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
}
.fullPageMenu {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background: #111;
transition: 0.5s;
}
.fullPageMenu.active {
top: -100%;
}
.fullPageMenu .banner {
position: relative;
width: 1000px;
height: 100%;
}
.fullPageMenu .banner img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.fullPageMenu .nav {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
overflow-y: auto;
}
.fullPageMenu .nav ul {
position: relative;
}
.fullPageMenu .nav ul li {
position: relative;
list-style: none;
padding: 0 20px;
margin: 5px 0;
overflow: hidden;
display: table;
}
.fullPageMenu .nav ul li:before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #21D4FD;
background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
transition: transform 0.5s ease-in-out;
transform: scaleY(0);
transform-origin: bottom;
}
.fullPageMenu .nav ul li:hover:before {
transition: transform 0.5s ease-in-out;
transform: scaleY(1);
transform-origin: top;
}
.fullPageMenu .nav ul li a {
position: relative;
color: #21D4FD;
text-decoration: none;
font-size: 2em;
font-weight: 600;
line-height: 1.5em;
display: inline-block;
text-transform: uppercase;
transition: 0.5s ease-in-out;
}
.fullPageMenu .nav ul li a::before {
content: attr(data-text);
position: absolute;
bottom: -100%;
left: 0;
color: #fff;
}
.fullPageMenu .nav ul li:hover a {
transform: translateY(-100%);
color: fff;
}
.menuicon {
position: fixed;
top: 20px;
right: 20px;
width: 60px;
height: 60px;
background: #fff url(https://i.postimg.cc/k4rb3zpp/pngwave.png);
background-size: 40px;
cursor: pointer;
background-repeat: no-repeat;
background-position: 10px;
border-radius: 50%;
}
.menuicon.active {
background: #fff url(https://i.postimg.cc/25t1dMY5/pngegg-1.png);
background-size: 30px;
background-repeat: no-repeat;
background-position: 10px;
}
.credit{
margin: 10px;
color:#fff;
}
.credit a{
text-decoration: none;
color: #21D4FD;
}
@media(max-width:991px) {
.banner {
display: none;
}
}
function menuToggle() {
var nav = document.getElementById("nav")
var toggle = document.getElementById("toggle")
nav.classList.toggle("active")
toggle.classList.toggle("active")
}
Thank you for reading our blog. If you face any problem creating this Full-Screen Navigation Bar using HTML, CSS & JavaScript, then contact us or comment us. We'll try to provide a solution to your problem as soon as possible.
Post a Comment
Thank you
Learning robo team