3

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:

enter image description here

And on the latest Firefox (v72) I see:

enter image description here

Looks like a bug in Firefox. Any idea on how to fix it, or can I achieve the same thing without flexbox? Thanks!

Codepen

justDan
  • 2,302
  • 5
  • 20
  • 29
Nuthinking
  • 1,211
  • 2
  • 13
  • 32

0 Answers0