you are here: Home arrow HTML/CSS arrow Set the background to a gradient using CSS
Set the background to a gradient using CSS
User Rating: / 16
PoorBest 
Saturday, 10 December 2005

Set the background to a gradient using CSS

This tutorial has the code need to make a gradient background using CSS, this can be used for the body or a table background

The code to set the background as a gradient is this:

background-color: #F8F8F8;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#CCCCCC' ,endColorStr='#E6E6E6' ,gradientType= '0' );

The background-color is needed for Firefox as this seems to be unsupported in Firefox.

The rest of the code is self explanitory you have the start colour and the finish colour and the gradientType.

When the gradientType is set to 0, it is vertical from top to bottom.

When the gradientType is set to 1, it is horizontal from left to bottom.

If you are viewing this site within Internet Explorer or an IE based browser, the title bar has its own gradient.





Reddit!Del.icio.us!Google!Live!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Squidoo!Free social bookmarking plugins and extensions for Joomla! websites!
 
< Prev   Next >
Based on valid XHTML 1.0 and CSS 2.0 code design by:pixelsparadise.com