HTML CSS examples for CSS Layout:Column Layout
make a fluid grid with fixed width columns
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container {<!--from ww w . ja v a2 s. c om--> width: 960px; margin: auto; overflow: auto; } @media only screen and (max-width : 960px) { .container { width: 640px; } } @media only screen and (max-width : 640px) { .container { width: 320px; } } .block { width: 300px; height: 300px; float:left; margin: 10px; background: #ccc; } </style> </head> <body> <div class="container"> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> </div> </body> </html>