Lee Lee - 1 year ago 98
CSS Question

CSS - Change border-color of div within anchor:hover

I have a div contained within an anchor like so:

<a class="chk" href="href">
<div class="chk-div"></div> Text Here

I want it so that when you hover over the
, the border-color of the child
changes. I know you can do it simply for the div like so:

.chk-div:hover {
border-color: green;

But I want it to change when you hover over the text also

Answer Source

Is this the sort of thing you're after?

.chk:hover .chk-div {border: solid 1px green;}


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download