HTML CSS examples for CSS Layout:Div Align
Align div along top
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #center {<!--from w w w . j a va 2 s . c o m--> margin:0px auto; } .floating-box, .floating-boxsmall { display:block; float:left; margin:11px 6px; background-color:Chartreuse; text-align:center; padding:21px; } .floating-box { min-height:100px; } </style> </head> <body> <div id="center"> <div class="floating-box"> No Content </div> <div class="floating-boxsmall"> No Content </div> <div class="floating-box"> No Content </div> <div class="floating-boxsmall"> No Content </div> <div class="floating-box"> No Content </div> <div class="floating-boxsmall"> No Content </div> </div> </body> </html>