position a div left to another div and top fixed to body - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Fixed Position

Description

position a div left to another div and top fixed to body

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">
body {<!-- www  . j  a  v  a 2  s. com-->
   margin:0;
}

.container {
   position:relative;
   width:71%;
   margin-right:auto;
   margin-left:auto;
   background-color:Chartreuse;
   height:1301px
}

.menu_fixed_left {
   position:fixed;
   left:calc(16% - 51px);
   top:0;
   background-color:yellow;
   width:51px;
   z-index:3;
}

ul {
   list-style-type:none;
   padding:16px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="menu_fixed_left"> 
    <ul> 
     <li>L</li> 
     <li>L</li> 
     <li>L</li> 
     <li>L</li> 
    </ul> 
   </div>Lorem ipsum 
  </div>  
 </body>
</html>

Related Tutorials