McDonalds - Car Loan - Internet Advertising - MySpace Editor - Payday Advance

PDA

View Full Version : BG images


velocity834
Jun 22nd 2006, 9:19 pm
How do i set the background of a cell in a table to an image?

sgtsloth
Jun 22nd 2006, 11:20 pm
You can do this with css:

<td class="tdWithBG">Stuff</td>

In your css file:


.tdWithBG
{
background: url(images/image.jpg);
}


Off the top of my head, but that should work.

hubdigital
Jun 23rd 2006, 5:19 pm
or you can use good 'ol table bg elements.

<td background="url">

Andrew

TechnoGeek
Jun 25th 2006, 6:48 am
Hello, velocity834.

The CSS background-image property (that can be shortened to background) is part of a group of assorted properties.

The background-image property sets the background image of an element. For example:

BODY { background-image: URL(/images/foo.gif) }

The background-repeat property determines how a specified background image is repeated. For instance, the "repeat-x" value repeats the image horizontally, while the "repeat-y" value repeats the image vertically.

The background-attachment property determines if a specified background image will scroll with the content or be fixed with regard to the canvas. If you want to specify a fixed background image:

background-attachment: fixed;

The background-position property gives the initial position of a specified background image: left, center, right, top, center, bottom.

vtechno42
Jun 29th 2006, 5:50 pm
How do i set the background of a cell in a table to an image?

If you work how I work with templates, and you just need to have a different background on multiple cells, but don't want to complicate the CSS file with a number of short classes or IDs, do it like this:

<td style="background-image: url('image.jpg');">