You can do this with CSS, see this link .
It uses CSS3 properties in good browsers and the IE property filterwhen using IE.
CSS
#gradient {
background: #FFFFFF;
background: -moz-linear-gradient(top, #FFFFFF 0%, #CCCCCC 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CCCCCC));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#CCCCCC',GradientType=0 );
}
... produces ...

source
share