- This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
Viewing 12 posts - 1 through 12 (of 12 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Is there a way to have anchors with the same href’s to both highlight when hovered over one of them?
You can with jQuery. Add this to your <headgt; section:
A class of ‘hover’ will be added to anchor links with the same href.
maybe with css… Like this
#anchorone:hover{
background: yellow;
}
#anchorone:hover #anchortwo{
background: yellow;
}
Your code would imply that he has a link inside a link.
@noahgelman: I believe it would imply that he has a div with an ID of anchortwo inside a div with an ID of anchorone. There is no anchor link markup.
@ChristopherBurton, I don’t believe so.
The id he used is ‘achorone’ that wouldn’t imply a div, but a link. I believe he was saying when you hover ‘achorone’ then a separate link, ‘anchortwo’, should get a background. Unfortunatelly that’s not how CSS works. It only cascades. I think he was trying to reselect another link on the page.
Yeeeeah, you are all right… I can’t think in another easy solution right now…
Jamy already provided the easiest solution!
Well the jQuery works: http://jsfiddle.net/wQnNQ/1/
Just add a class in the links you want to do somenthing, or will apply to all links…
Update: http://jsfiddle.net/wQnNQ/5/
@noahgelman: My apologies. I was just going off the CSS he posted which implied a div with an ID since an anchor tag was not specified in the markup.
@ChristopherBurton, no apologies needed.