Position: absolute and automatic width via content - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Position: absolute and automatic width via content

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_1 {<!--from w ww . j  av  a  2s . co  m-->
   position:absolute;
   top:21px;
   left:21px;
}

.container_2 {
   position:absolute;
   width:96px;
   overflow:hidden;
   white-space:nowrap;
}
</style> 
 </head> 
 <body> 
  <div class="container_1"> 
   <div class="container_2">
     Lorem ipsum dolo 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials