To ensure that the light bulb is positioned exactly above the text, one solution could be to place the background code within a pseudo-element so that it can be easily aligned with the text.
This concise code snippet creates some space above the element using padding - the actual implementation may vary based on the specific layout considerations, such as positioning relative to a navbar.
a {
font-size: 16px;
padding-top: 20px;
display: inline-block;
position: relative;
}
a::before {
content: '';
position: relative;
height: 20px;
aspect-ratio: 1 / 1;
left: 50%;
top: 0;
transform: translate(-50%, -100%);
display: inline-block;
}
a:hover::before {
background-image: url('https://i.sstatic.net/dp2LF.png');
background-repeat: no-repeat;
background-position: center top;
background-size: contain;
}
<a href='#'>Hover</a>