HTML CSS examples for CSS Layout:Position
Logo in navigation bar positioning
<html lang="en"> <head> <style> body {<!--from w w w . j a va 2 s . c o m--> margin:0; } header { display:flex; align-items:baseline; justify-content:space-between; min-height:100vh; background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat 11% 11% / cover; } .header-content { margin-top:3em; display:-webkit-box; display:-ms-flexbox; display:flex; -ms-flex-direction:column; flex-direction:column; justify-content:center; align-items:center; text-align:center; } header a, header a:visited { color:Chartreuse; text-decoration:none; padding-bottom:0.2em; } header a:hover { color:yellow; } .logo { padding-right:0; } nav { display:-webkit-box; display:-ms-flexbox; display:flex; -ms-flex-direction:row; flex-direction:row; font-weight:401; color:blue; font-size:.9em; margin-top:3em; margin-left:31em; } nav a { margin:2em; } nav a, nav a:visited { padding-bottom:0.2em; letter-spacing:0.2em; text-decoration:none; color:pink; } nav a:hover, nav a:active { color:OrangeRed; } </style> </head> <body translate="no"> <header> <div class="logo"> <a> <img style="height: 50px;" src="https://www.java2s.com/style/demo/Google-Chrome.png"> </a> </div> <div class="header-content"> <nav> <a href="#section-one">Lorem ip</a> <a href="#section-two">Lorem ips</a> <a href="#section-three">Lorem ipsum d</a> <a href="#section-four">Lorem i</a> <a href="#section-five">Lorem ipsu</a> </nav> </div> </header> </body> </html>