html - Navigation Bar with centered Logo -
i have searched through similar questions found no solutions looking specifically. trying navigation bar around centered logo, number of links on either side of logo. however, if window smaller, links should appear below logo. trying achieve effect of page: http://www.colbowdesign.com/index.html
here code far:
html
<header> <img src="assets/ck-square.png" class="logo"> <ul> <li><a href="#">work</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> <li><a href="#">social</a></li> </ul> </header>
css
.logo { margin-left: auto; margin-right: auto; display: block; } header li{ display: inline; } header { width: 100% height: auto; border-style: solid; margin: 0; padding: 0; }
i appreciate , feedback/help!
the solution based on using media queries change layout small screen desktop .
<header> <h2 id="logo">logo</h2> <ul class="nav"> <li><a href="#">work</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> <li><a href="#">social</a></li> </ul> </header> header { width: 90%; margin: 0 auto; } #logo { text-align: center; } .nav { text-align: center; } .nav li { display: inline; margin-right: 1em; } /* use media query change layout */ @media (min-width: 768px) { body { background-color: #f2f2f2; } .nav { margin-top: -42px; } .nav li:nth-child(1), .nav li:nth-child(2) { float: left; } .nav li:nth-child(3), .nav li:nth-child(4) { float: right; } }
see live http://jsbin.com/arexuq/2/
Comments
Post a Comment