Jump to content

Connecting link to td tag


horsebox

Recommended Posts

I have a table and the td's switch between two classes with this

onmouseover="className='navon'" onmouseout="className='navoff'"

so that the background color changes when you hover over them. Take a look

http://toxicopoeia.com/

hover over that latest articles table. Problem is the links don't look good with that dark gray background so I need to make them brighter. What would be the easiest way to get the links to change color too?

Link to comment
Share on other sites

Why would the text change color? It's not the link. That is likely to be confusing to your users.

 

It's impossible to have sibling elements change color on a rollover. As such, you cannot make text that is not part of the link change color when then link is rolled over. You can however do it with a parent element:

 

<div id="wrapper">
  <a>link</a>
  <p>text</p>
</div>

 

#wrapper a
{
  color: #0C4F00; // green
}

#wrapper p
{
  color: #000; // black
}

#wrapper:hover a
{
  color:#00FF0B; // bright green
}

#wrapper:hover p
{
  color:#FFF; //white
}

 

When the parent div is hovered, the colors of the child elements will change.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.