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

Possible to hover over one object & format another object?

Status
Not open for further replies.

may1hem

Programmer
Jul 28, 2002
262
GB
Hi, I have a couple of images in cells of a table, as well as some text in another table cell.

I want the text to change colour when I hover over an image. Is this possible? Can CSS change the formatting of an object that it doesn't directly apply to?

Also, how can I make the whole table clickable and point to the same link? I tried the code below but only the border of the table is clickable.

---------------------------
<a class=&quot;class1&quot; href=&quot;myLink.html&quot;>
<table>
<tr>
<td><img src=&quot;image1.jpg&quot;></td>
</tr>
<tr>
<td>This is my content text.</td>
</tr>
<tr>
<td><img src=&quot;image2.jpg&quot;></td>
</tr>
</table>
</a>
---------------------------

Any ideas?

Thx,
May

 
This is possible but would deffiently take alot of work...I know there are scripts for highlighting a table but You should post in a Javascript forum
Jammer1221
 
Thanks for your suggestion but I'm looking for a non-JavaScript solution to this.

Can anyone else help?

Thx,
May
 
Why would you not want to use Javascript...its a client side programming language so if the user has IE 3+ or NN 4+ the user should be able to view your page in javascript...if you would like some help with the javascript post back here with exaclty what you want
Jammer1221
 
Understandably, your code works nicely in Mozilla (1.4) and Opera (7.22) but not in IE (6). Again, the CSS solution for changing the appearance of table cells in the table-link is working in the above browsers, IE will however require some javascript. There's nothing else I can do to help you.
Code:
<style>
a:link td,
a:visited td { background: red; }
a:hover td { background: blue; }
</style>

<a href=&quot;[URL unfurl="true"]http://www.google.com&quot;>[/URL]
 <table border=&quot;1&quot; width=&quot;500&quot;> 
  <tr> 
   <td>row 1, col 1</td>
   <td>row 1, col 2</td>
  </tr>
  <tr> 
   <td>row 2, col 1</td>
   <td>row 2, col 2</td>
  </tr>
  <tr> 
   <td>row 3, col 1</td>
   <td>row 3, col 2</td>
  </tr>
 </table>
</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top