I am trying to achieve a help cursor when hovering over a button, but the issue is I can’t set the hover effect on the button itself (I only want to affect certain buttons and its not possible to set a unique class name on this specific button). I’ve instead opted to render the button inside another div which I am hoping to set the cursor hover effect on. However it only works on the very outer edge of the button. Any insight in how I can make this work with my div setup is hugely appreciated
Codepen:
https://codepen.io/sgoldberg/pen/vGzGYL
.container {
width: 400px;
border: solid 1px black;
height: 400px;
cursor: help;
.button {
width: 100%;
height: 100%;
}
<div class="container">
<button class="button"> Hover Button </button>
</div>
3
Answers
I give you two solutions, use witch one you want.
First solution, find the element inside its parent then give it the cursor:
Second solution, find the element inside its parent then give it a custom cursor:
I hope this solves your problem!
If you want just one specific element to have a certain styling, try using an id tag. https://www.w3schools.com/cssref/sel_id.php
& css: