position permanent div in custom place on page - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

position permanent div in custom place on page

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  a 2s  .  c o  m-->
   height:401px;
   width:401px;
   overflow-y:scroll;
   border:2px solid Chartreuse;
}

.fixed {
   height:21px;
   width:151px;
   border:2px solid yellow;
   background:gray;
   position:fixed;
   top:21px;
   left:21px;
}

.content {
   height:1201px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="fixed">
     Lorem ipsum dolo 
   </div> 
   <div class="content">
     &nbsp; 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials