I want my links to zoom out a bit whenever I hover over it, However I have no idea how I can separate the links to do hover individually.
body{
background: gray;
}
.link a {
font-size: 25px;
color: #ffffff;
background-color: rgba(255, 255, 255, 0.41);
border-style: solid;
border-width: 1px;
padding: 3px;
border-radius: 10px;
text-decoration: none;
}
.link a:hover {
color: #000000;
}
<div class='link' style="text-align:center" style="text-decoration:none">
<a id='left' href="how.html">How to Avoid Fighting</a>
<a id='center' href="why.html">Why You Should Not Fight</a>
<a id='right' href="Ways.html">Ways to Fight</a>
</div>
This is what I have but I can’t figure out how to stop the links from hovering together.
2
Answers
It’s not clear to me what you want to do, if you want to change the font size on mouse hover you can do it in your .link a:hover rule
If you mean to scale the elements when on hover, you could use
transform: scale(1.2);
so that the link will get bigger.It’s important to note that the browser default for the
display
css property of an<a>
element isdisplay: inline
and as such it wouldn’t have a size at all and the scaling wouldn’t work.So to make it work you need to change it as
display: inline-block