I am trying to create a small button with a X (font-awesome's <i class="fa fa-close"></i>
). I am trying to make it look something like this:
However, I am facing some issues with getting the X centered inside the button.
Here is the markup:
<button class="cart-remove">
<i class="fa fa-close"></i>
</button>
And the css:
.cart-remove {
width: 20px;
height: 20px;
position: absolute;
top: -5px;
right: -5px;
background-color: #fff;
border-radius: 50%;
text-align: center !important;
}
Unfortunately the font-awesome close icon does not center, it appears at the bottom right. How can I fix this? I thought text-align center centers the stuff inside that element?
Thanks