Right after an anchor tag, I have an H1 element. The line-height of the H1 element is set to '0.9' for design purposes.
As a result, the computed height of the H1 becomes shorter, but the actual Text element inside overflows and covers part of the anchor tag. This makes it difficult to click on the link. (Tested in Chrome and Safari, where the bottom two thirds of the link are un-clickable)
To demonstrate the boundaries, I added borders to both elements and selected part of the title in my browser to show how the overflowing text hides the link:
https://i.sstatic.net/7nbeZ.png
The issue can be resolved by applying overflow: hidden
to the H1, but I am curious if there are cleaner solutions available.
a {
border: 1px solid blue;
}
h1 {
color: magenta;
font-size: 120px;
margin-top: 0px;
line-height: 0.9;
border: 1px solid magenta;
}
<a href="www.google.com">Link Covered By </a>
<h1>Title</h1>
You can observe the problem here: CodePen