Is there a way to ensure that the link stays contained within the div element and does not extend beyond it? It seems like the padding is causing an issue where the div considers the link to be as tall as the text.
Any solutions or workarounds?
Check out this fiddle for reference
Here's the code snippet:
div {
background-color: yellow;
margin-top: 20px;
}
a {
padding: 10px;
border: 1px solid black;
background-color: blue;
}
a:link {
color: white;
}
<div><a href="#">Link button</a></div>