html - foundation 6: how to center horizontal navigation with image -
i use zurb foundation 6 , i'm pretty happy it. i'm struggling header. goal implement main navigation this: how can center menu items inside horizontal navigation image (logo) divider?
my attempt use ul list nav items:
<nav class="row header show-for-large"> <div class="large-5 column"> <ul class="main-nav-left"> <li>women</li> <li>men</li> <li>store</li> <li>blog</li> </ul> </div> <div class="large-2 column "> <%= image_tag("test-logo.png", alt: "nile logo") %> </div> <div class="large-5 column"> <ul class="main-nav-right"> <li>en & fr</li> <li>login</li> <li>wunschliste</li> <li>warenkorb</li> </ul> </div> </nav>
i migrated centered top bar logo building block foundation 6. should after.
html
<!-- small navigation --> <div class="title-bar" data-responsive-toggle="nav-menu" data-hide-for="medium"> <a class="logo-small show-for-small-only" href="#"><img src="http://placehold.it/50x50?text=logo" /></a> <button class="menu-icon" type="button" data-toggle></button> <div class="title-bar-title">menu</div> </div> <!-- medium-up navigation --> <nav class="top-bar" id="nav-menu"> <div class="logo-wrapper hide-for-small-only"> <div class="logo"> <img src="http://placehold.it/350x150?text=logo"> </div> </div> <!-- left nav section --> <div class="top-bar-left"> <ul class="vertical medium-horizontal menu"> <li><a href="#">menu 1</a></li> <li><a href="#">menu 2</a></li> <li><a href="#">menu 3</a></li> </ul> </div> <!-- right nav section --> <div class="top-bar-right"> <ul class="vertical medium-horizontal dropdown menu" data-dropdown-menu> <li class="has-submenu"> <a href="#">menu 4</a> <ul class="submenu menu vertical medium-horizontal" data-submenu> <li><a href="#">first link in dropdown</a></li> </ul> </li> <li class="has-submenu"> <a href="#">menu 5</a> <ul class="submenu menu vertical" data-submenu> <li><a href="#">first link in dropdown</a></li> </ul> </li> </ul> </div> </nav>
scss
/* variables */ // adjust width accordingly (use #'s) $logo-width: 118px; // reduce px value increase space between logo , menu text $logo-padding: $logo-width - 32px; // leave alone $logo-margin: - ($logo-width / 2); /* small navigation */ .logo-small { float: right; } .title-bar { padding: 0 .5rem; } .menu-icon, .title-bar-title { position: relative; top: 10px; } /* medium-up navigation */ @media screen , (min-width: 40rem) { .logo-wrapper { position: relative; .logo { width: $logo-width; height: 92px; position: absolute; left: 50%; right: 50%; top: -6px; margin-left: $logo-margin; } } // right part .top-bar-right { width: 50%; padding-left: $logo-padding; ul { float: left; } } // left part .top-bar-left { width: 50%; padding-right: $logo-padding; ul { float: right; } } }
Comments
Post a Comment