I have the following css code:
Which generates a hover over an image.
The hover effect is a blue cover and a white arrow which slides in from the left.
Like so:
Unhovered:
Hovered:
"\f04b" is the white arrow. How can I center the icon in the blue box? I tried adding padding to
sidebar-article-thumb:before, .sidebar-best-thumb:before
but it adds padding to the entire blue overlay, not the white icon inside.
How can I center the icon inside the blue box?
.sidebar-article-thumb img,
.sidebar-best-thumb img {
border: 1px solid #021a40;
position: relative;
max-width: none;
height: 100%;
width: auto;
left: 50%;
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.sidebar-article-thumb:before,
.sidebar-best-thumb:before {
content: "\f04b";
font-family: FontAwesome;
font-size: 40px;
color: #fff;
position: absolute;
top: 0;
left: -100%;
height: 100%;
width: 100%;
background: #00ade6;
z-index: 1;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
}
I found the following: :before, :after and padding
Which seemed relevant, but could not figure out how to apply it to the above css.