Do absolute positioning in CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Do absolute positioning in CSS

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">
#container {<!--from  w  w w  . j  a v  a2s.  c o  m-->
   float:left;
   position:relative;
}

.trans_caption {
   background-color:Chartreuse;
   bottom:0;
   position:absolute;
   text-align:center;
   width:100%;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
   <div class="trans_caption">
     Lorem ipsum dolor 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials