2-Header

Video

Steps

  1. Let's work on the items that will go inside the <header> tag now.

  2. First, the login menu. Our end goal, after adding CSS, will be something like this:

    Final Header

  3. Let's add some code to stub out the menu.

    <body>
         <header>
             <!--Login menu-->
             <nav>
                 <ul>
                     <li><a href="#"><img src=""></a></li>
                     <li><a href="#"><img src=""></a></li>
                     <li><a href="#"><img src=""></a></li>
                     <li><a href="#"><img src=""></a></li>
                     <li><input type="search" id="search" placeholder="Search"></li>
                 </ul>
             </nav>
             <!--Navigation Menu-->
         </header>
  4. If you ran the app right now, it should look like this:

    First Run

    Isn't it gorgeous?

  5. Let's start to fill in details for each one of the list items, seen in the code as <li>. The big three of Facebook, Twitter, and Google Plus (poor Google Plus) are good for now:

    <!--Login menu-->
    <nav>
         <ul>
             <li><a href="#"><img src="img/facebook_20.png" alt="Facebook" border="0" class="socialIcon" /></a></li>
             <li><a href="#"><img src="img/twitter_20.png" alt="Twitter" border="0" class="socialIcon" /></a></li>
             <li><a href="#"><img src="img/google_plus_20.png" alt="Google Plus" border="0" class="socialIcon" /></a></li>
             <li><a href="#"><img src=""></a></li>
             <li><input type="search" id="search" placeholder="Search"></li>
         </ul>
    </nav>
  6. Please note: These links will not go anywhere. The reason is the octothorpe symbol aka hashtag, pound sign, number sign, sharp sign, etc. You can find it in the <a href> tag above. If you want it to work, replace the # with a URL.

  7. We're calling the image from the img folder. We're also adding alt here. Doing so will provide a clear text alternative of the image for screen reader/visually impaired users.

  8. We're also setting up a class for future use with our CSS.

  9. Let's add details for the login and basket:

    <header>
         <!--Login menu-->
         <nav>
             <ul>
                 <li><a href="#"><img src="img/facebook_20.png" alt="Facebook" border="0" class="socialIcon" /></a></li>
                 <li><a href="#"><img src="img/twitter_20.png" alt="Twitter" border="0" class="socialIcon" /></a></li>
                 <li><a href="#"><img src="img/google_plus_20.png" alt="Google Plus" border="0" class="socialIcon" /></a></li>
                 <li><a href="#" class="active">Login</a></li>
                 <li><a href="#">My Basket</a></li>
                 <li><input type="search" id="search" placeholder="Search"></li>
             </ul>
         </nav>
         <!--Navigation Menu-->
    </header>
  10. Then, we can add some nav items for the menu.

        <!--Navigation Menu-->
        <h1>Fromage</h1>
        <h2>Market</h2>
        <nav>
            <ul>
                <li><a href="#">Shop Now</a></li>
                <li><a href="#">Cheese 101</a></li>
                <li><a href="#">Contact</a></li>
                <li><a href="#">Recipes</a></li>
            </ul>
        </nav>
    </header>
  11. If you run the app, here's how it should look up to this point.

    More Detail

    Looks a bit better, but this isn't the '90s.

  12. Let's work on the sidebar next.

Last updated