Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gradient in table background

Status
Not open for further replies.

bxgirl

Programmer
Nov 21, 2005
75
0
0
US
thread215-1347419

I am attempting to apply a gradient to a table cell's background using css, with repeat-y property.

The gradient image repeat for the height of the table but not smoothly from top to bottom. It breaks after it reaches the height of the image. How can make this work so that no matter how far down the form extends, the gradient will look smooth.

I'm trying to do something similar to the form on this site:

Thanks in advanced.
 
You should make a 1px wide and whatever you want pixel high image of your gradient and repeat it on the x. That way different parts of the gradient will be seen depending on the size of the cell. In addition to that you add the background colour to the cell which is equivalent to the bottom most colour of the gradient. In this way, it will always look smooth.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Also, the form on that side is a fixed size @ 500px high, and chances are the background image used is also 500px high, and hence the smooth gradient.

Another technique you could use in conjunction with Vragabond's post is to set your gradient to fade in with a background color of the cell - this way, you'll still get a gradient effect in the cell, and if the cell is larger than your gradient image, it will simply blend in with the background color.

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top