Ecommerce Website Header Design

Ecommerce Website Header Design
Code Snippet:website header
Author: Divyansh Sengar
Published: January 19, 2024
Last Updated: January 22, 2024
Downloads: 1,298
License: MIT
Edit Code online: View on CodePen
Read More

This code snippet helps you to design an Ecommerce Website Header with a navigation menu. It comes with a search bar, a logo, and navigation links for product categories.

You can use this code to enhance the header of your e-commerce website. It provides a professional and user-friendly look to your site, making it easier for visitors to navigate and find products. The CSS styling ensures a pleasing visual appearance, while the structure organizes important information efficiently.

How to Create Ecommerce Website Header Design

1. First, include the Font Awesome library by adding the provided CDN link in your HTML’s <head> section. This ensures you can use Font Awesome icons in your header.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

2. In the following HTML code, there are well-structured layout. The header is divided into two parts, with elements for your business information and a search bar. Copy the following code and paste it on your website. Replace the placeholder content with your own text, links, and images.

<header class="header-wrapper">
            <div class="header-part-1">
                <div class="price-match-guarantee"><a href=#><strong>Price Match Guarantee*</strong></a></div>
                <div class="header-part-1-phone"><a href=#><i class="fa fa-phone"></i>&nbsp;&nbsp;609.666.4464</a></div>
                <div class="vertical-line-small"></div>
                <div class="header-part-1-lock"><a href=#><i class="fa fa-lock"></i>&nbsp;&nbsp;Sign In</a></div>
                <div class="vertical-line-small"></div>
                <div class="header-part-1-user"><a href=#><i class="fa fa-user"></i>&nbsp;&nbsp;My Account</a></div>
                <div class="currency"><div>USD</div></div>
            </div>

            <div class="header-part-2">
                <div class="logo"><img src="https://cdn11.bigcommerce.com/s-3954e/images/stencil/original/cricketfinl_1406918929__14870.original.png"></div>
                <div class="search-bar"><input type="text" placeholder="Search the store"></div>
                <div class="search-button"><i class="fa fa-search fa-lg"></i></div>
                <div class="favourite"><i class="fa fa-heart fa-2x"></i></div>
            </div>
        </header>
        <div class="navbar">
            <div class="navbar-link-holder">
                <a href=#>CRICKET BAT</a>
                <a href=#>CRICKET EQUIPMENT</a>
                <a href=#>BALLS</a>
                <a href=#>CRICKET SHOES</a>
                <a href=#>ACCESSORIES</a>
                <a href=#>CLOTHES</a>
                <a href=#>KIDS</a>
                <a href=#>SALE</a>
                <a href=#>PRO QUALITY UNIFORM</a> 
            </div>
    </div>
    <div class="banners">
        <div class="banner1">
            <img src="https://cdn2.bigcommerce.com/server300/3954e/product_images/uploaded_images/truck.png">&nbsp;
            <strong>FREE DELIVERY*</strong><br>&nbsp;&nbsp;with coupon
        </div>
        <div class="vertical-line-small-2"></div>
        <div class="banner2">
            <img src="https://cdn2.bigcommerce.com/server300/3954e/product_images/uploaded_images/price-match.png">&nbsp;
            <strong>PRICE MATCH</strong><br>&nbsp;&nbsp;Guarantee
        </div>
        <div class="vertical-line-small-2"></div>
        <div class="banner3">
            <img src="https://cdn2.bigcommerce.com/server300/3954e/product_images/uploaded_images/dispatch.png">&nbsp;
            <strong>SAME DAY DISPATCH</strong><br>&nbsp;&nbsp;before 1pm (Mon-Fri)        
        </div>
        <div class="vertical-line-small-2"></div>
        <div class="banner3">
            <img src="https://cdn2.bigcommerce.com/server300/3954e/product_images/uploaded_images/easy-return.png">&nbsp;
            <strong>EASY RETURN</strong><br>&nbsp;&nbsp;Policy        
        </div>
    </div>

3. Now, add the following CSS code to your website. You can adjust the styles to match your website’s branding. This includes changing colors, fonts, margins, and other visual elements. Customize it to align with your website’s design.

body{
                font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            }
            .header-wrapper{
            
            }
            .header-part-1{
                display: flex;
                background-color: #f2f2f2;
                height: 50px;
            }
            .price-match-guarantee{
                margin-left: 150px;
                margin-top: 12px;
                color: #293991;
            }
            .price-match-guarantee a{
                text-decoration: none;
                color:  #293991;
            }
            .price-match-guarantee a:hover{
                color:#ff5c00;
            }
            .header-part-1-phone{
                margin-left: 700px;
                margin-top: 12px;
                color: black;
                
            }
            .header-part-1-phone:hover{
                color: #ff5c00;
            }
            .vertical-line-small{
                border-right: 2px black solid;
                height: 25px;
                margin: 12px 10px;
            }
            .header-part-1-lock{
                margin-top: 12px;
                color: black;
            }
            .header-part-1-lock:hover{
                color: #ff5c00;
            }
            .header-part-1-user{
                margin-top: 12px;
                color: black;
            }
            .header-part-1-user:hover{
                color: #ff5c00;
            }
            .currency{
                width: 70px;
                height: 50px;
                background-color: lightslategray;
                margin-left: 30px;
                color: white;
            }
            .currency div{
                margin-top: 12px;
                margin-left: 19px;
            }
            .header-part-2{
                display: flex;
                background-color: white;
                margin-top: 0px;
                height: 100px;
            }
            .logo{
                margin-left: 150px;
                margin-top: 8px;
            }
            .search-bar input{
                height: 35px;
                width: 380px;
                margin-top: 28px;
                margin-left: 170px;
                border-top-left-radius: 3px;
                border-bottom-left-radius: 3px;
            }
            .search-button{
                height: 41px;
                width: 60px;
                margin-top: 28px;
                background-color: red;
                color: white;
                border-top-right-radius: 3px;
                border-bottom-right-radius: 3px;
            }
            .search-button i{
                margin-top: 12px;
                margin-left: 19px;
            }
            .search-button:hover{
                background-color: #293991;
            }
            .favourite{
                margin-top: 35px;
                margin-left: 80px;
            }
            .navbar{
                border: 2px white solid;
                height: 60px;
                width: 100%;
                background-color: #293991;
            }
            .navbar-link-holder{
                margin-top: 19px;
                text-align: center;
            }
            .navbar-link-holder a{
                text-decoration: none;
                padding: 20px;
                color: white;
            }
            .navbar-link-holder a:hover{
                background-color: #ed1c24;
            }
            .banners{
                border: 1px white solid;
                width: 100%;
                height: 60px;
                display: flex;
                margin-top: 10px;
            }
            .banner1{
                border: 1px white solid;
                margin-top: 7px;
                margin-left: 240px;
            }
            .banners img{
                float:left;
                margin-top: 10px;
            }
            .vertical-line-small-2{
                border-left: 2px grey solid;
                margin-left: 50px;
                margin-right: 50px;
                margin-top: 10px;
                margin-bottom: 10px;
            }
            .banner2{
                border: 1px white solid;
                margin-top: 7px;
            }
            .banner3{
                border: 1px white solid;
                margin-top: 7px;
            }
            .header-part-1-phone a{
                text-decoration: none;
                color: black;
            }
            .header-part-1-lock a{
                text-decoration: none;
                color: black;
            }
            .header-part-1-user a{
                text-decoration: none;
                color: black;
            }
            .header-part-1-phone a:hover{
                color: #ff5c00;
                
            }
            .header-part-1-lock a:hover{
                color: #ff5c00;
            }
            .header-part-1-user a:hover{
                color: #ff5c00;
            }

That’s all! hopefully, you have successfully integrated this Ecommerce Website Header Design into your project. If you have any questions or suggestions, feel free to comment below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X