HTML CSS examples for CSS Layout:Position
Place Navbar over Logo and maintain position when scaled
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!-- w ww . j a v a 2 s. co m--> max-width:961px; margin:auto auto; } #logo { z-index:2; max-width:651px; margin:0 auto; } #logo img { display:block; max-width:100%; max-height:100%; text-align:center; margin:0 auto; } #nav { z-index:3; position:relative; display:block; width:100%; min-width:401px; height:51px; margin:-17px auto 0 auto; text-align:center; background:gray; } #nav ul li { display:inline-block; padding:2em; } </style> </head> <body> <div class="container"> <div id="logo"> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </div> <div id="nav"> <ul> <li>Lorem </li> <li>Lorem i</li> <li>Lorem ips</li> <li>Lorem ips</li> </ul> </div> </div> </body> </html>