Create and Use a Graduated .PNG Image
Create the image
- Create a new document with a width of 10px and a height equal to your site's maximum height (use 900px if you aren't sure), in RGB color mode and 72 pixels per inch with transparent background.
- Set the foreground color to white.
- Set the gradation tool to change from white to transparent.
- Using the Gradation tool, draw a gradation line from top to bottom.
- Constrain the line by holding the shift key down while drawing the line.
- Change the opacity from 100% to 90% (or less if you prefer) so you can color the background with CSS later.
- File->Save the file as .psd so you can edit again later.
- File->Save for the Web.
- Reduce the width to 1px or so, to reduce file size.
- Choose .png for true transparancy.
- Watch the file size; it may be too big to meet your requirements.
Add the image to your Cascading Style Sheet (CSS)
body {background-image:url(white-gradation.png); background-color:#993300}
Remember that text cannot be easily read on a high-contrast background, so use other means such as boxes to provide a reading surface.
Variations
- Super-Easy Blendy Backgrounds
- Matthew O'Neill of A List Apart.
- Cross-browser semi-transparent backgrounds
- DaltonLP
- Cross-Browser Variable Opacity with PNG: A Real Solution
- by Michael Lovitt, A List Apart
- Scalable CSS Buttons using PNG and Background-colors
- David's Kitchen
- Gradient Image Maker
- Dynamic Drive