HTML CSS examples for CSS Widget:Div Table
center a grid of divs
<html> <head> <title>Lorem ipsum dolor sit amet, co</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .container<!--from ww w. j a v a2s .c om--> { text-align:center; } .block { display:-moz-inline-stack; display:inline-block; vertical-align:top; zoom:2; *display:inline; width:251px; height:100px; background:Chartreuse; margin:2%; } </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 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>