Position:absolute and fill remaining space in div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Position:absolute and fill remaining space in div

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
* {<!--from  w  ww  . ja v a  2 s .com-->
   margin:0;
   padding:0;
}

#carry {
   position:fixed;
   width:100%;
   height:100%;
   border:2px solid Chartreuse;
}

#left {
   position:absolute;
   width:calc(100% - 201px);
   height:100%;
   overflow:hidden;
   border:2px solid yellow;
}

#image {
   width:2001px;
   height:2001px;
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png')
}

#imagetag {
   background-color:blue;
   padding:9px;
   position:absolute;
   bottom:51px;
   right:51px;
}

#right {
   position:absolute;
   right:0;
   background-color:pink;
   width:201px;
   height:100%;
   border:2px solid OrangeRed;
}
</style> 
 </head> 
 <body translate="no"> 
  <div id="carry"> 
   <div id="left"> 
    <div id="imagetag">
      Lorem ipsum dolor s 
    </div> 
    <div id="image"></div> 
   </div> 
   <div id="right"></div> 
  </div>  
 </body>
</html>

Related Tutorials