I wanted to link a .png image with a transparent background on my website.
After trying the following HTML:
<a href="index.html">
<img border="0" src="smiley.png" alt="smiley" width="150" height="150">
</a>
and CSS:
a
{
text-decoration: none;
color: inherit;
}
The issue remained as the entire image was clickable, including its transparent background.
Below is an example of what I am aiming for:
***Disclaimer: The image used in this demonstration is purely for illustrative purposes. I can confirm that my actual picture has a transparent background.***
How can I make only the visible part (smiley face) of my image clickable as a link?