I am trying to put an image inside of as a logo link, but there is always a 4px space on the bottom. I know I can set height 50px for to solve the problem, but I want the height of is depend on the . So, my question are, where is 4px space come from? And How can I solve it?
Here is the code:
<!DOCTYPE HTML>
<html lang="en">
<head>
<style>
body{
margin: 0;
padding: 0;
}
nav{
position: fixed;
top: 0;
right: 0;
left: 0;
background: rgba(0,0,0,0.5);
z-index: 10;
}
a{
text-decoration: none;
color: black;
}
</style>
</head>
<body>
<nav>
<a href="#"><img src="Logo.png" alt="Logo" width="50" height="50"></a>
</nav>
</body>
</html>
Here is the result(I do not want 4px space on the bottom):
Thanks Quentin this is a duplicate question, I am sorry about that. The answer is here "White space at bottom of anchor tag"