3 ms·
Afaik, the browser will read GIF once and keep the bitmap in memory, then composite it into the right place when it needs it, which is a lot cheaper. With SVG,
by lucian1900 14y ago
Afaik, the browser will read GIF once and keep the bitmap in memory, then composite it into the right place when it needs it, which is a lot cheaper.
With SVG, the browser will render it once and keep a bitmap, then composite it.
With a CSS icon, there is no way for the browser to know that it's an icon at all. There is no clear delimitation between it and the rest of the page. The browser has no choice but to re-render it every single time.
Images or SVG are much better choices for icons than a bunch of CSS.
- jrmuizel 14y agoThe rasterization of the Unicode character will be cached in the glyph cache just like the rest of the glyphs, so the GIF is not really any cheaper.
- lucian1900 14y agoOk, SVG, character and GIF are better than a bunch of CSS :)
- hei_zen 14y agoYou misunderstood a lot of things. Most importantly that replacing a graphic with a unicode char has something to do with CSS :-)
- lucian1900 14y agoMy original comment is a reply to the suggestion to use a CSS icon.
- user-id 14y agoWell, using the :before or :after pseudo-selector and content property is a possibility.
- deleted 14y ago[deleted]