Have block level element fill 100% width of overflow-x: scroll container - HTML CSS CSS Property

HTML CSS examples for CSS Property:overflow-x

Description

Have block level element fill 100% width of overflow-x: scroll 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">
#one {<!--from w  w w  .  jav a  2s .c  o  m-->
   width:201px;
   overflow:auto;
   border:solid 2px;
}

#one h1 {
   font-size 1.1em;
   background-color: blue;
   display: inline-block;
   width: 100%;
   margin-top: 0;
   position:relative;
}
table td {
   border:solid 2px;
   padding:21px;
}

h1:after {
   content:"";
   background:blue;
   position:absolute;
   top:0;
   bottom:0;
   width:100%;
   left:100%
}
</style> 
 </head> 
 <body>
   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorpe 
  <div id="one"> 
   <h1>Lorem </h1> 
   <table> 
    <tbody> 
     <tr> 
      <td>Lore</td> 
      <td>Lore</td> 
      <td>Lore</td> 
      <td>Lore</td> 
      <td>Lore</td> 
      <td>Lore</td> 
     </tr> 
    </tbody> 
   </table> 
  </div>  
 </body>
</html>

Related Tutorials