Relative Positioning Multiple Divs Same Class - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

Relative Positioning Multiple Divs Same Class

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">
.question {<!--  w  w  w. java 2s  . c om-->
   text-align:center;
   position:relative;
   top:201px;
   background:red;
}

.container {
   background:blue;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="question">
     Lore 
   </div> 
   <div class="question">
     Lore 
   </div> 
   <div class="question" style="top: 0px">
     Lore 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials