i have two elements inside a container. i would like when hover the first the border becomes yellow and when hover the second the border of the first becomes yellow again.
here is my code :
<div class="container">
<a href="#" class="href1"></a>
<a href="#" class="href2"></a>
</div
.href1, .href2
{
display:block;
width:100px;
height:100px;
}
.href1
{
background:red;
border:2px solid #000;
margin-bottom:30px;
}
.href1:hover
{
border-color:yellow;
}
.href2
{
background:blue;
}
.href2:hover .href1
{
border-color:yellow;
}
i made an example http://jsfiddle.net/df5dwsq8/
i dont know why this is not working. if someone could help me i would appreciate it.