How can I use a:hover in inline CSS inside the HTML style attribute like this but doesn't work
<div
style={{
"&:hover": {
background: "#efefef"
},
}} >
</div>
How can I use a:hover in inline CSS inside the HTML style attribute like this but doesn't work
<div
style={{
"&:hover": {
background: "#efefef"
},
}} >
</div>
You can do this way.
a:hover {
background-color: yellow;
}
See the full answer here. https://codepen.io/charp95/pen/LYQxZrm
<a href="mypage.html"
onMouseOver="this.style.color='#FFF'"
onMouseOut="this.style.color='#000'" >Whatever you have to display</a>
You can try this, using onMouseOver and onMouseOut, this gives the same effect but it's not efficient for many elements.