Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I do this trick with css and/or javascript?

Tags:

javascript

css

This is the code:

HTML:

<img src="..." />

// other stuff 

<div id="image">
<a href="" > bla bla bla </a>
<a href="" > ble ble ble </a>
</div>

CSS:

#image a:hover{color:green;}

I want this:

When the user put mouse over the image, then all the links in the div with id "image" become green ( like if the user put the mouse over the links. ).

If possible I prefer to do this with only CSS.

like image 924
xRobot Avatar asked Jun 28 '26 03:06

xRobot


1 Answers

img:hover + #image a {
    color: green;
    text-decoration: none;
}

http://jsfiddle.net/Tzpmd/

like image 133
Adrift Avatar answered Jun 30 '26 18:06

Adrift