HTML CSS examples for CSS Layout:Responsive Layout
HTML/CSS - Responsive 3 column navigation bar
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .navWrap {<!-- w ww. j ava2 s.c o m--> margin:auto; width:961px; } .nav { float:left; width:100%; } .navLeft { width:21%; float:left; padding:11px 0; background-color:Chartreuse; } .navCenterWrap { margin:auto; width:6%; } .navCenter { float:left; width:100%; padding:11px 0; background-color:yellow; } .navRight { width:31%; float:right; padding:11px 0; background-color:blue; } @media screen and (max-width: 740px) { .navWrap { width:100%; } } @media screen and (max-width: 520px) { .navWrap { width:100%; } .navLeft { width:41%; margin:0; } .navCenterWrap { width:6%; float:left; } .navRight { width:56%; margin:0; } } </style> </head> <body> <div class="navWrap"> <div class="nav"> <div class="navLeft"></div> <div class="navCenterWrap"> <div class="navCenter"></div> </div> <div class="navRight"></div> </div> </div> </body> </html>