Auto-size container with fixed image to fill the gap - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Auto-size container with fixed image to fill the gap

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  ww  . j  a v a  2s  .com-->
   width:51%;
   height:100px;
   margin:0 auto;
   border:2px solid Chartreuse;
}

.image {
   height:100px;
   width:100px;
   background-color:yellow;
   float:left;
}

.text {
   width:calc(100% - 100px);
   height:100px;
   background-color:blue;
   float:left;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div class="image">
     image 
   </div> 
   <div class="text">
     text 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials