I read a tip to make a <div>
into a link here:
Make a div into a link
One of the answers there suggested that this would work even within a table.
The goal is to make clickable, several items of text in an image, without using an image map or CSS. The image is positioned on the page in a table cell, and the <div>
is inside the <td>
so that the link is properly positioned over the text in the image.
It works as intended EXCEPT, the background image in the table cell is repeated, after adding a <div>
.
Here is the code:
<td height="419" align="left" valign="top" background="images/bg_FINAL.jpg"><img src="newimages/Splashpage.jpg" alt="" style="position:relative; left:0; top:0; " >
<div style="height:100px; width:142px; float:none; position:relative; left:265px; top:-223px; " >
<a href="http://SomeURL.com" style="position:absolute; top:0; left:0; width:100%; height:100%; display:block; " ></a>
</div>
</td>
The bg_FINAL.jpg image is repeated below the normal height of the table (419px in this case), and I don't understand why. Removing the <div>
immediately makes it look normal again (with a solid color bordering the table).
P.S. As a new user, I can't post images (need 10 reputation points apparently), but here are two screenshots showing the problem: