Is there a way to perfectly center align font awesome icons vertically? I have tried using the line-height
property when text is present, and even setting the line-height
equal to the height of the div.
Attempts with display:inline-block
and vertical-align:middle
didn't yield the desired results.
How can I dynamically center the icons vertically regardless of their size variations? Hardcoding a margin-top value may not work for all sizes of icons within the same div.
CODE
.exp{
width:80px;
height:80px;
background-color:red;
border-radius:100%;
line-height:80px;
text-align:center;
vertical-align:middle;
display:inline-block;
}