Position relative and right property - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

Position relative and right property

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">
.parent {<!--from   w w w  .j a v a2  s.  c  om-->
   position:relative;
   width:100%;
}

.right {
   position:absolute;
   width:201px;
   height:201px;
   background:red;
   top:0;
   right:0;
}
</style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="right"></div> 
  </div>  
 </body>
</html>

Related Tutorials