I am attempting to use flex to center an icon within two divs. Below is the code snippet:
.div-1 {
width: 50px;
height: 50px;
display: flex;
border-radius: 50%;
background-color: #228B22;
}
.div-2 {
margin: auto;
}
i {
color: #ffffff;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<div class="div-1">
<div class="div-2">
<i class="fa fa-leaf fa-2x" aria-hidden="true"></i>
</div>
</div>
This approach works well on most of the browsers I have tested, except for IE11 where the icon fails to vertically center and remains stuck at the top instead. Can someone suggest a solution to this issue or point out what might be incorrect in my implementation?