+ 1
Change other element on hover
Hi i have hr into a div. I want change hr color when hover on div. How?
4 Answers
+ 2
This will help you:
https://code.sololearn.com/Whx9QRFM0k3z/?ref=app
+ 1
hr:hover {
background-color: yellow;
}
0
<div id="trigger">hover me</div>
<hr id="aim"/>
CSS:
#trigger:hover+#aim{
color:red;
}
/*if it is not working, then
#trigger:hover~#aim{
color:red;
}
/*that's it!
/*happy coding.