Create A CSS 3D Menu Navigation Bar | No JavaScript Using HTML

Create A CSS 3D Menu Navigation Bar | No JavaScript Using HTML


Welcome to my website U-GINE MEDIA. In this website I teach tutorials and share source code on some programming (HTML, CSS & JavaScript) tutorials. 

Before we get started, do well to subscribe to my channel to never miss out on any update that I post every single day.

In this tutorial topic "Create A CSS 3D Menu Navigation Bar | No JavaScript Using HTML", we will learn how to create it following these simple easy steps.

Share this to your programmer friends. If y'all learnt something today, make sure to let me in the comments. 

If interested in watching the video before running the code below, you can click the play button to get started.


Code Begins

  1. First, create a folder with any name you like. Then, make the necessary files inside it.
  2. Create a file called index.html to serve as the main file.
  3. Create a file called style.css for the CSS code.
  4. Finally, go to Font Awesome and embed their cdnjs library link to your main file

To start, add the following HTML codes to your index.html file. These codes include essential HTML markup with different semantic tags, such as div, form, input, button, image, etc., to build the website layout. 


<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="font-awesome.css">
    <link rel="stylesheet" href="index.css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS 3D Navigation Bar</title>
</head>
<body>

    <ul>
        <li style="--i:6;" data-icon="&#xf015"><a href="#">Home</a></li>
        
        <li style="--i:5;" data-icon="&#xf2bc"><a href="#">About</a></li>
        
        <li style="--i:4;" data-icon="&#xfb25"><a href="#">Services</a></li>
        
        <li style="--i:3;" data-icon="&#xf0f2"><a href="#">Portfolio</a></li>
        
        <li style="--i:2;" data-icon="&#xf0c0"><a href="#">Our Team</a></li>
        
        <li style="--i:1;" data-icon="&#xf234"><a href="#">Contact</a></li>
    </ul>
    
</body>
</html>

Finally, add the following CSS codes to your style.css file to make your AI image generator website beautiful and user-friendly. You can customize the different CSS properties, such as color, background, font, etc., to give a personalized touch to your website. 


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222;
}

ul {
    position: relative;
    transform: skew(-15deg);
}

li {
    position: relative;
    list-style: none;
    width: 200px;
    padding: 15px;
    background: #3e3f46;
    z-index: calc(1 * var(--i));
    transition: 0.5s;
}

li:hover {
    background: #996fae;
    transform: translateX(-50px);
}

li::before {
    font-family: "FontAwesome";
    color: #999;
    display: flex;
    justify-content: center;
    align-items: center;
    content: attr(data-icon);
    position: absolute;
    top: 0;
    left: -40px;
    width: 40px;
    height: 100%;
    background: #2e3133;
    transform-origin: right;
    transform: skewY(45deg);
    transition: 0.5s;
}

li:hover::before {
    background: #7b5190;
}

li::after {
    content: "";
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 40px;
    background: #35383e;
    transform-origin: bottom;
    transform: skewX(45deg);
    transition: 0.5s;
}

li:hover::after {
    background: #86539d;
}

li a {
    text-decoration: none;
    color: #999;
    font-family: "Roboto";
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    transition: 0.5s;
}

li:hover a {
    color: #fff;
}

li:last-child::after {
    box-shadow: -120px 120px 20px rgba(0,0,0,0.5);
}


Conclusion and Final word

Now, we have reached the end of our code, for any information, you can comment any problem or code-not-working issues to resolve it, am always with you. You can also visit my YouTube Channel for more updates on HTML, CSS & JavaScript Designs. I believe you can create "A CSS 3D Menu Navigation Bar | No JavaScript Using HTML". and do so much more with codes. Go extremely far in exploring the world of HTML, CSS & JavaScript, its gonna be fun, trust me 😃.

Happy Coding Journey 🚀

Post a Comment

0 Comments

Close Menu