Create Animated Navigation bar Menu Using CSS

Learn How to create animated navigation bar menu using CSS. This tutorial can be followed by any beginner who has knowledge of Basic HTML and CSS. Video tutorial along with code is provided to you below.

Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./index.css">
    <title>By Reecry</title>

<style>


*{
    margin: 0px;
    padding: 0px;
}

body{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


nav{
    background-color: teal;
    display: flex;
    justify-content: center;
    height: 100vh;
    align-items: center;
}

nav > a{
    color: white;
    font-size: 1.5em;
    text-decoration: none;
    margin: 1em;
    position: relative;
}

nav > a:before, nav > a:after{
    content: "";
    width: 100%;
    height: 3px;
    background-color: white;
    position: absolute;
    transition: all .5s ease-in-out;
    -webkit-transition: all .5s ease-in-out;
    -moz-transition: all .5s ease-in-out;
    -ms-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    opacity: 0;
}

nav > a:before{
    top: 0px;
    transform: translateY(-20px);
    -webkit-transform: translateY(-20px);
    -moz-transform: translateY(-20px);
    -ms-transform: translateY(-20px);
    -o-transform: translateY(-20px);
}

nav > a:after{
    left: 0px;
    bottom: 0px;
    transform: translateY(20px);
    -webkit-transform: translateY(20px);
    -moz-transform: translateY(20px);
    -ms-transform: translateY(20px);
    -o-transform: translateY(20px);
}

nav > a:hover:before{
    transform: translateY(0px);
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    opacity: 10;
}

nav > a:hover:after{
    transform: translateY(0px);
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    -o-transform: translateY(0px);
    opacity: 10;
}

</style>

</head>
<body>


    <nav>
        <a href="">Home</a>
        <a href="">Contact Us</a>
        <a href="">About Us</a>
    </nav>


</body>
</html>

More HTML and CSS Designs With Code and Tutorials

reecry

Recent Posts

Fly DJI Avata 2 Backward Using the Motion Controller

How to Fly DJI Avata 2 Backward Using the Motion Controller! 🎮 https://youtu.be/UOZU47AxPwk In this…

3 weeks ago

Insta360 – Videos keep exporting backwards | Wrong side render in insta360

https://youtu.be/0RRUOIvmuWA I realized that I had my camera set up incorrectly, so when I upload…

1 year ago

Make Animated progress step bar using Figma

https://youtu.be/C3oFfV20K_c Make Animated progress step bar using Figma

1 year ago

How to Hide All Grids in Figma

https://youtu.be/o3pSH_oRzko How to Hide All Grids in Figma

1 year ago

How to Create Responsive Tool tip in figma

https://youtu.be/hdSUylKSsho How to Create Responsive Tool tip in Figma

1 year ago