I just realised Firefox doesn't render a button with icon correctly. Because the icon is an image, I made the button flex (in real life an inline-flex). Given this basic markup:
button {
font-size: 12px;
line-height: 16px;
display: flex;
justify-content: center;
padding: 0 30px;
height: 40px;
}
i {
display: inline-block;
width: 16px;
height: 16px;
background-color: red;
margin-right: 5px;
}
<button><i></i>Label</button>
On the latest Chrome (v79) I see:
And on the latest Firefox (v72) I see:
Looks like a bug in Firefox. Any idea on how to fix it, or can I achieve the same thing without flexbox? Thanks!