Having an issue with formatting an anchor link using transform scale attributes on hover.
The link is inside a div that's aligned to the right, and I want it to enlarge when hovered over. However, this increase in size also affects the parent div, causing other elements on the page to move. Why is this happening? Shouldn't scale only affect the element itself, not its parent?
If you can point out where I'm going wrong, I'd appreciate it. I'm new to HTML and CSS, so I might have set up my code incorrectly.
Thanks to anyone who can offer assistance.
a#fonte1 {
font-size: 1rem !important;
font-weight: 300 !important;
transition: transform 0.2s ease !important;
display: inline-block !important;
}
a#fonte1:hover {
transform: scale(1.2) !important;
cursor: pointer !important;
color: rgb(13,89,253) !important;
border: 1px solid rgb(13,89,253) !important;
border-radius: 0.3rem !important;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="197b76766d6a6a2000000">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iFdUauVt94HftDCEXSoBoQvjIWr WfqylQZjIW3" crossorigin="anonymous">
<section class="showcase border-bottom">
<div class="container-fluid p-0">
<div class="row g-0">
<div class="col-lg-6 order-lg-2">
...
</div>
<div class="col-lg-6 order-lg-1 ">
<h2>[title 1]</h2>
<p class="mb-0" style = "text-align: justify">
...
</p>
<div style="text-align:right;">
<a id="fonte1" href="#">
Link
</a>
</div>
</div>
</div>
<div class="row g-0">
<div class="col-lg-6 ">
...
</div>
<div class="col-lg-6 ">
<h2>[title 2]</h2>
<p class="mb-0" style = "text-align: justify">
...
</p>
</div>
</div>
</div>
</section>