Lee Lee - 2 months ago 13
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


Is this the sort of thing you're after?

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