I'm trying to make an Font Awesome icon scale from the center when hovered over it. But every time I hover it, it scales and moves to the bottom right corner.
.field {
height: 100px;
width: 100px;
border: 2px solid black;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.field i {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 70px;
transform-origin: center;
}
.field .fa-times {
transition: 0.5s;
color: red;
}
.field .fa-times:hover {
transform: scale(1.5);
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div class="field">
<i class="fa fa-times"></i>
</div>
I expect this Times icon to scale from the center.