HTML CSS examples for CSS Widget:Color
fill a div with different colors
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #test{<!-- ww w . j av a2 s .c o m--> height:200px; width:200px; } .block1 { width:200px; height:50px; background:red; } .blue { background:blue; } .green { background:green; } .yellow { background:yellow; } </style> </head> <body> <table id="test"> <tbody> <tr> <td> <div class="block1"> </div> <div class="block1 blue"> </div> <div class="block1 green"> </div> <div class="block1 yellow"> </div> </td> </tr> </tbody> </table> </body> </html>