I think what you're looking for is a div to be filled with a background image (which is a gradient) and then the rest of the way with a solid color?
If so, in photoshop (or the image editor of your choice), get the hex of the last pixel in your gradient. For argument's sake, let's say it is #FF0000. Then do this:
.myDiv {
background: #FF0000 url(green_bg.gif) repeat-x 0 0;
}
This will fill your background with #FF0000 (red) and overlay your background image on top of it, repeating horizontally (x-axis) starting at the top of your div. The way to make the red background show is to increase the amount of content in your div.
Also, if you want to make sure that a certain portion of your gradient is always showing, you can increase the padding-top
in your CSS.
.myDiv {
background: #FF0000 url(green_bg.gif) repeat-x 0 0;
padding-top: 20px;
}
If this isn't what you're getting at, please clarify in your question.