Using absolute positioning in CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Using 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">
div {<!-- ww w  .ja v  a  2s.  com-->
   height:100px;
   width:100px;
   background:Chartreuse;
   margin:100px;
}

div span {
   display:none;
}

div:hover span {
   height:21px;
   width:100%;
   position:absolute;
   background:yellow;
   bottom:0;
   display:block;
}
</style> 
 </head> 
 <body> 
  <div> 
   <span></span> 
  </div>  
 </body>
</html>

Related Tutorials