DEV Community

Cover image for Navbar Components using HTML CSS
Ganesh Patil
Ganesh Patil

Posted on

3 3

Navbar Components using HTML CSS

Navigation bar is most important component of your website because it is the center attraction when anyone visit to your website so its important to look attractive.
Here is following code for Navbar in website

HTML Code

<header>
            <nav>
                <div class="ig">
                    <a href="https://github.com/ganeshpatil386386" target="_blank" id="git">
                    <img src="./assets/Logo.png" id="lg" alt="" srcset="">
                    <p style="text-align:left;font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;">ganeshpatil386386</p>
                </a>
                </div>
                <input type="text" name="" id="search-box" placeholder="Explore Projects">
                <ul>
                    <li><a href="#first">Website Dev</a></li>
                    <li><a href="#second">Software Dev</a></li>
                    <li><a href="#Third">Mobile Dev</a></li>

                </ul>
            </nav>
        </header>
Enter fullscreen mode Exit fullscreen mode

CSS Code

Now we need to add interaction and attractive part with CSS to our website component I developed website for GitHub repo showcase you can visit and check on my GitHub profile.

{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}
body{
    background-color: #F05454;
}
header{
    position: fixed;
}
nav{
    display: flex;

}
#lg{
    height: 80px;
    align-items: center;

}
.ig{
    margin: 10px;
}
#git{
    text-decoration: none;


}
#search-box{
    width: 25rem;
    height: 2rem;
    border: none;
    border-radius: 6px;
    padding-left: 5px;
    box-shadow: 2px 2px 1px 2px #fff;
    margin: 30px;
    display: flex;

}
nav ul{
    display: flex;
    list-style: none;
    margin: 33px;
}
nav a{
    text-decoration: none;
    padding: 6px 10px;
    font-size: 17px;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;

}
nav a:hover{
    border-bottom: 2px solid black;
    transform: 0.5px ease;
}
Enter fullscreen mode Exit fullscreen mode

This is simple navigation bar component for our website so its no need JS for completed code visit my GitHub profile and check it out...!!
GitHub project Link
don't forget hit like button and follow me GitHub for web development projects.
also conn with me Twitter
Thankyou for reading express your views in comment section...!!

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay