Skip to main content

Create NavBar using HTML & CSS (flexbox) - scoobcode

The navigation bar is the most important part of a webpage or website. There have many ways to make a beautiful navbar. Here in this blog, we are going to learn some basic use of flexbox. How to create a navbar using flexbox property in CSS.

I've also uploaded the full tutorial video you can check the video. Click here to watch the video.

To start the code we need a code editor or IDE. Here I use Visual studio code (recommended) for my coding. To download Visual studio code click here

Here is the output

NavBar using HTML CSS (Flexbox)

Tips

Press ! to get Emmet Abbreviation (Work in Visual studio code)

Source code

    HTML code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NavBar</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <header>
        <a href="#">Logo</a>
        <nav>
            <a href="#">Home</a>
            <a href="#">About</a>
            <a href="#">Plans</a>
            <a href="#">Contact</a>
        </nav>
        <input type="button" value="Join">
    </header>
    <h1>Hello World</h1>
</body>
</html>

    CSS code

*{
    box-sizing: border-box;
    margin: 0%;
    padding: 0%;
    background-color: black;
}
header{
    display: flex;
    justify-content: space-between;
    padding: 20px 10%;
}
a, input{
    font-family: monospace;
    font-size: 20px;
    color: wheat;
    text-decoration: none;
}
nav a{
    padding: 0px 20px;
    transition: all 0.3s ease 0s;
}
nav a:hover{
    color:rgb(82,214,196);
    font-size: 25px;
}
input{
    padding: 5px 20px;
    border: none;
    border-radius: 8px;
    background-color: rgb(82,214,196);
    transition: all 0.3s ease 0s;   
}
input:hover{
    background-color: rgb(6, 51, 250);
    padding: 5px 30px;
}
h1{
    color: wheat;
    text-align: center;
    position: relative;
    top: 200px;
    font-size: 50px;
}

You can support me to like this blog and share it with your programmer friends. Go to my youtube channel scoobcode and watch the full tutorial video.

Comments

Popular posts from this blog

Add preloader animation on website just some step of code (HTML, CSS, JavaScript) - scoobcode

Preloader is a unique feature for a website, this gives a professional look to a website. Here in this blog, I will share my code, where you going to learn how to add a preloader animation effect in just some line of HTML, CSS, and JavaScript code. Note: Copy the code and make your own design. Also, go to our YouTube channel for more useful content. Full video tutorial:  https://youtu.be/7KNABcF-xz0 Output Preloader animation After preloader Source code 👉  HTML <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Simple landing page</title>     <link rel="stylesheet" href="style.css"> </head> <body>     <div id="preloader"></div>     </div>     <header>

Automate Google chrome dino game for unlimited score using JavaScript - scoobcode

Dino game is one of the most popular games developed by google. It's a browser-based offline game. Whenever the score increases this game will be more difficult for players. Here in this blog, I will give a single line of code to automate this game for unlimited scores. Full video tutorial:  https://youtu.be/ti3bYMWRb1k Note: Copy the code and make your own design. Also, go to our YouTube channel for more useful content. Steps Click on the right button of the mouse and select Inspect option Then go to the Console tab Write the code or copy the code from the bellow section and paste in the  Console tab Source code 👉  JavaScript Runner.instance_.gameOver = () => {} You can support me to like this blog and share it with your programmer friends. Go to my youtube channel  scoobcode  and watch the full tutorial video.

Add google font in website | how to insert custom font in website - scoobcode

As per the requirement sometimes web developers have to use an external custom font style. And this requirement can be fulfilled by Google font. There have many websites to fulfill the requirement. But the reason behind why I choose this place because google font most user-friendly, fast, and reliable. Here in this blog, I will share some steps to add google font to your website code. Also, I had already uploaded the full video tutorial on our YouTube channel. You can also check out our video. Full video tutorial:  https://youtu.be/qNT-pli5qTM Note: Copy the code and make your own design. Also, go to our YouTube channel for more useful content. Steps Step 1: Search Google font in any browser or go to this link  font.google.com Step 2: After opening the website choose any font face Step 3: Select any font style Step 4: Two way of getting code Step 5: Copy the link and paste your HTML code (Method 1) Step 6: Paste the code in your HTML file Step 7: Add the CSS code Step 8: Check the outp