I'm currently experimenting with creating a link for an h1 title that transforms when hovered over. It's working perfectly fine, but I'm facing an issue - if I place the /a tag outside of the h1 element, the entire element becomes clickable and reacts to hover, which doesn't look good. On the other hand, if I put the /a tag inside the /h1 tag, only the text is clickable as intended, but it doesn't respond to hover effects (although other changes work).
As a beginner, I may not have provided all the necessary context for you to assist me effectively.
The following CSS code allows hover functionality, but makes the entire element clickable:
#headlines a:hover {
transform: scale(1.5);
transition: 0.1s;
}
<div class="grid_6" style="color: black; text-align: center">
<a href="headlines.html"
id="headlines"
style="text-decoration: none; color: black">
<h1> Headlines
</h1></a>
<hr>
</div>