Align div along top - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Div Align

Description

Align div along top

Demo Code

ResultView the demo in separate window

<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>

Related Tutorials