I am building a map with some arrows on it, these arrow trigger some actions when the user click them.
I am using a character similar to this one ^ to draw the arrows, what I want is to change its color when user moves the mouse over it. What I need is to avoid triggering the event when the mouse hovers under the character, I made the line-height property smaller and added some padding on the top, so the background area is adjusted to cover the character shape only, it looks something like this:
The background area has its height reduced
The problem is the :hover, it continues triggering on the "Original Character area", it is ignoring the line-height property, if you move the mouse under the colored area it will trigger the hover and change the text color.
I need the :hover property to trigger on the text line-height or the colored background only.
Is this possible?
div{
color: white;
font-size: 40px;
line-height: 5px;
background-color: red;
padding-top: 12px;
width: 20px;
}
div:hover{
color:black;
}
<div>^</div>

