I am currently experimenting with creating an icon that functions similar to font-awesome
. When I apply a specific class, it should display an image based on the font size. Surprisingly, I got it to work in Chrome but for some reason, the same code doesn't seem to function properly in Firefox.
div {
font-size: 14px;
}
.custom-icon-jazz {
content: url(https://image.ibb.co/iHHaWS/jazzcash_color_logo.png);
height: 2em;
width: 4em;
}
.custom-icon-jazz::before {
content: url(https://image.ibb.co/iHHaWS/jazzcash_color_logo.png);
height: 2em;
width: 4em;
}
<div>
<i class="custom-icon-jazz"></i>
</div>
::before
seems to only be effective in Firefox. In contrast, Chrome applies the normal class without any issues.
To simplify this issue, I have created a demonstrative pen which showcases how the image appears in different sizes across various browsers. By visiting this link, you can observe the discrepancies between Firefox and Chrome's rendering of this pen.