Forum Moderators: not2easy

Message Too Old, No Replies

Replacing a background image with css

Can you make a two color background repeat itself without using an image?

         

athinktank

3:44 am on Jan 28, 2004 (gmt 0)

10+ Year Member



I would like to create an element that would be made from css (thus not needing an image) to create a backround that fills another element, like the entire body or a specific table cell.

I guess a good way to go about this is with a discription. Keep in mind, I am wondering if this can be done WITHOUT an image.

discription:
I have a table cell that is 50px wide. I would like to create a horizontal bars, 2px X 50px. These bars would fill the cell vertically and alternate color and fill up the space in the table cell. Black bar, grey bar, black bar, grey bar, black bar, etc, until the space is filled.

I would not like to hard code this, but rather, let the window size determine how many little suckers to throw in there.

If I could use a <div> element as the backround and set it to repeat, then I would be golden, but don't think that that is possible.

Any one know of any kewl hacks out there that would address my problem? I have been able to replace all of the other images with nifty css tricks, but can not figure this one out...

DrDoc

3:54 am on Jan 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is not possible to do what you want without the use of an image. Sorry.