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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fixed image background within a table cell?!

Status
Not open for further replies.

missundastood61

Technical User
Jul 27, 2003
2
0
0
GB
does anyone know how to do this? i am creating a website with tables. it has 2 cells, the first one containing the navigation and links, and the second with text, on a fixed image background but i cant get it to work. please, help, where do i need to insert the code to get the image to remain fixed within cell no. 2? so far, the best i have got is the two cells and a fixed background, but not within the cell. thanks for any help.
 
I'm sure there are many ways to do this, but I just had a similar instance where I used css. Positioning is critical here, so it can't be used without fixing positions. There are other options in css that let you position backgrounds over specified areas, but the following was a quick fix for my situation:


<tr>
<td width=&quot;130&quot;>navigation</td>
<td width=&quot;200&quot;><span style=&quot;position: absolute; left: 130; top: 5; z-index: -1&quot;>
<img border=&quot;0&quot; src=&quot;/images/wolf2_6.jpg&quot; width=&quot;200&quot; height=&quot;156&quot;></span>
this will go over the top
</td>
</tr>

Z index is heirarchy - (-1) would put it in the background.

Hope this helps -

 
Using some style like this might be easier and won't require you to count pixels.

.backgroundimage {
background-image: url(image.gif);
background-position : top;
background-repeat : no-repeat;
}

MrBelfry
 
May we see what you did? I would be interested in seeing an example at work. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top