HTML CSS examples for CSS Widget:Color
Add a color in the <div> bottom content area
<html> <head> <style> div{height:100px; width:100px; background:gold;position:relative;} div:after{<!--from w ww.j a v a 2 s . c om--> content: ''; position: absolute; height:50px; top:0; background:blue; width: 100px; } div:before{ content: ''; position: absolute; height:50px; bottom:0; background:green; width: 100px; } </style> </head> <body> <div></div> </body> </html>