Fixed position div inside div container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

Fixed position div inside div container

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">
.wrapper {<!--from  www  .j  av a2s.c  o  m-->
   width:100%
}

.container {
   width:301px;
   margin:0 auto;
   height:1501px;
   background:Chartreuse;
}

.element {
   background:yellow;
   position:fixed;
   width:51px;
   height:71px;
   top:51px;
   right:0px;
   left:369px;
   border:2px solid blue;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <div class="container"> 
    <div class="element">
      Lorem i 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials