Uses

All pages should have a header. The header provides the user with not only an identity for the entire site, but also a roadmap for the site's content.

Styles

The top of the footer should be a brand red color (#a51417). This top section should include any important navigational links that do not necessarily fit in the main navigation. Below this section, the main logo is displayed on a white background. If the site benefits from a search bar, this can be placed next to the logo. Finally, below the logo is the site's main navigation.

Examples

The above shows the header on the School of Medicine site. The use of the brand color - red (#a51417) - is displayed along with the logo to help provide a sense of identity.

Code

HTML
<div class="header-wrap"> <nav id="utility-bar" class="clearfix"> <div class="wrapper top-nav"> <ul id="action-nav"> <li></li> </ul> <ul id="utility-nav" class="clearfix"> <li></li> </ul> </div> </nav> <div id="header-site-row" class="clearfix"> <div class="wrapper clearfix"> <div id="site-title"> <a href="https://medicine.wustl.edu"> <img src="https://medicine.wustl.edu/wp-content/themes/medicine/_/img/header-logo.svg" > </a> </div> <div class="utility-wrapper"> <form name="search" method="get" id="search-form" autocapitalize="none" action="https://medicine.wustl.edu/"> <p><label for="search-box">Search</label><br> <input type="text" id="search-box" name="s"> <button type="submit" class="submit" id="search-btn"></button> </p></form> <div id="mobile-menu-icon"> <img src="https://medicine.wustl.edu/wp-content/themes/medicine/_/img/menu.svg"> <img src="https://medicine.wustl.edu/wp-content/themes/medicine/_/img/close.svg" > </div> </div> </div> </div> <nav id="main-nav" class="menu-header-container"> <div class="wrapper"> <ul> <li><a href="https://medicine.wustl.edu">Home</a></li> <li><a href="https://medicine.wustl.edu/about">About</a></li> </ul> </div> </nav> </div>
CSS
header { position: relative; width: 100%; z-index: 10000; } header h2 { margin-top: 0; } #header-logo-row { background-color: #fff; } .wrapper { margin: 0 auto; max-width: 960px; position: relative; } #header-logo { float: left; margin: 10px; } #utility-bar, .top-nav { position: relative; background-color: #A51417; height: 43px; z-index: 1000; } #utility-nav { position: absolute; right: 0; list-style-type: none; margin-top: 6px; } #utility-nav li { float: left; padding: 7px 15px; } #utility-nav li.last-child { border: none; } #utility-nav li a:hover { color: #fff; } #action-nav { position: absolute; left: 0; list-style-type: none; margin-top: 6px; } #action-nav li { float: left; padding: 7px 15px 7px 10px; } #action-nav li.last-child { border: none; } #utility-nav li a, #action-nav li a { color: #fff; letter-spacing: .5px; font-weight: 700; font-size: 14px; } #action-nav li a:hover { color: #fff; } #header-text, .mobile-archive, #print-logo { display: none; } #header-site-row { position: relative; z-index: 200; background: #fff; } .ie-lt8 #header-site-row { height: 80px; } #mobile-menu-icon, #mobile-search-icon { display: none; } #search-form { float: right; position: absolute; margin-right: 10px; width: 240px; top: 50%; margin-top: -18px; right: 0; } #search-form p { position: relative; } #search-form p br { display: none; } #search-form label { position: absolute; top: 10px; left: 10px; cursor: text; color: #6c7373; font-size: 14px; font-style: italic; font-weight: 600; letter-spacing: 1px; } #dirform input[type=text] { max-width: 242px; } input[type=text], input[type=email] { padding: 8px; border-radius: 5px; border: 1px solid #ccc; } textarea { border-radius: 5px; border: 1px solid #ccc; } #search-box { margin: 0; width: 200px; height: 17px; padding: 10px 30px 10px 10px; border: 1px solid #c8c8c8; outline: 0; border-radius: 5px; background: #fff; color: #3d3d3d; letter-spacing: 1px; font-size: 12px; font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif; } #search-btn { position: absolute; top: 50%; margin-top: -7px; padding: 0; right: 10px; cursor: pointer; border: 0; background: none; } #search-btn img { display: block; } .ie7 #search-btn { height: 18px; } #site-title img { width: 607px; height: 33px; } #site-title a { float: left; margin: 27px 0 15px 10px; color: #fff; } #site-title-mobile { display: none; } #main-nav { height: 40px; border-bottom: 1px solid #cccccc; white-space: nowrap; background-color: #fff; position: relative; z-index: 199; } #main-nav ul { list-style-type: none; margin-left: 10px; } #main-nav li { float: left; padding: 11px 30px 0 0; } #main-nav li a { font-size: 15px; font-weight: 600; color: #A51417; text-transform: uppercase; letter-spacing: .5px; } #main-nav li > a:hover, #main-nav li.current-menu-item > a, #main-nav li.current-page-ancestor > a { color: #717171; }