Fill div with 2 colors as background - HTML CSS CSS Property

HTML CSS examples for CSS Property:background-color

Description

Fill div with 2 colors as background

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   ww w  .ja v a2  s. c  o  m-->
   background: #ccc;
   border-right: 40px solid #aaa
}
.offset {
   margin-right: -40px;
   zoom: 1; /* to fix IE7 and IE6 */
   position: relative /* to fix IE6 */
}


      </style> 
 </head> 
 <body> 
  <div id="container"> 
   <div class="offset">
     this is a test this is a test this is a test this is a test this is a test this is a test this is a test 
     this is a test this is a test this is a test this is a test this is a test this is a test this is a test 
     this is a test this is a test this is a test this is a test this is a test this is a test this is a test 
     this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test 
     this is a test this is a test this is a test this is a test this is a test this is a test 
     this is a test this is a test this is a test this is a test this is a test this is a test 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials