I want to create this round facebook button that interchanges color on hover. But I have not been able to change the child element using the > but I'm not even sure I am doing it right. here is my code
<div class="alignright" id="facebook-round">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css" rel="stylesheet" />
<a class="facebook-round" style="color: rgba(44, 33, 33, 1);" href="https://www.facebook.com/pages/Mio-Natural/613852868659014">
<i class="fa fa-facebook fa-3x"></i>
</a>
</div>
The css I made is this
#facebook-round {
width: 3.8em;
height: 3.8em;
border-radius: 4em;
background: #807D7D;
}
#facebook-round i{
margin-top: 0.22em;
margin-left: 0.12em;
color:rgba(44, 33, 33, 1);
}
#facebook-round:hover {
width: 3.8em;
height: 3.8em;
border-radius: 4em;
background: rgba(44, 33, 33, 1);
}
.facebook-round {
text-decoration:none;
}
#facebook-round:hover >i {
width: 3.8em;
height: 3.8em;
border-radius: 4em;
color: #807D7D;
}
here is a fiddle http://jsfiddle.net/D8ZKf/ Another thing I want to know is if it is possible to target a parent based on the child element meaning if I have a particular property for a parent element should be applied only if the child element exists. I can do this using Javascript but is it possible using plain CSS ? My questions lack research, sorry about it.