HTML CSS examples for CSS Layout:Responsive Layout
Responsive navigation aligned on each other
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .menu {<!--from w w w . j a va2 s .com--> font-family:"roboto", "sans-serif"; } .menu ul { list-style-type:none; margin:0; padding:0; overflow:hidden; } .menu li { text-align:center; padding:9px; margin-bottom:8px; background-color:Chartreuse; color:yellow; box-shadow:0 2px 4px blue, 0 2px 3px rgba(0, 0, 0, 0.25); } .menu li:hover { background-color:pink; } @media only screen and (max-width: 650px) { [class*="col-"] { width:100%; } } @media only screen and (min-width: 650px) { #left { float:left; } } @media only screen and (min-width: 650px) { #right { float:right; } } @media only screen and (min-width: 650px) { li a { display:block; } } @media only screen and (min-width: 650px) { #left li { float:left; } } @media only screen and (min-width: 650px) { #right li { float:right; } } </style> </head> <body> <div class="menu"> <ul id="left"> <li> <a href="#">Lore</a> </li> <li> <a href="#">Lorem</a> </li> </ul> <ul id="right"> <li> <a href="#">Lorem ips</a> </li> <li> <a href="#">Lorem i</a> </li> </ul> </div> </body> </html>