Get a td background color to stretch from left to right - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Get a td background color to stretch from left to right

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 {<!--   w  ww .j av  a2s  .  c  om-->
   width:1001px;
}

div {
   width:100%;
   padding-left:41px;
   margin:0px auto;
}

.coloured {
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div>
    Lorem ipsum 
  </div> 
  <div class="coloured">
    Lorem ipsum 
  </div> 
  <div>
    Lorem ipsum 
  </div> 
  <div class="coloured">
    Lorem ipsum 
  </div>  
 </body>
</html>

Related Tutorials