make CSS take into account a sidebar with absolute positioning - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

make CSS take into account a sidebar with absolute positioning

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
div.relative {<!-- w ww . j a  v  a 2  s  . c  om-->
   width:601px;
   height:100%;
   border:4px solid Chartreuse;
   display:flex;
   flex-direction:row-reverse;
   flex-wrap:nowrap;
   justify-content:flex-end;
}

div.absolute {
   width:100px;
   border-right:4px solid yellow;
}
</style> 
 </head> 
 <body> 
  <center> 
   <div class="relative">
     Lorem ipsum dolor sit amet, consectetur ad 
    <div class="absolute">
      Lorem ipsum dolor sit amet, consectetur ad 
    </div> 
   </div> 
  </center>  
 </body>
</html>

Related Tutorials