Note that there are some explanatory texts on larger screens.

plurals
  1. POFirefox and Opera: SVG & background-size results in bad rendering
    primarykey
    data
    text
    <p>I have some elements on a page that use a SVG-file as a background image. It works well in Opera, Chrome and Safari, only Firefox renders the graphics really pixelated. </p> <p>I already did a search on that topic, there are even some similar questions here on SO:<br> <a href="https://stackoverflow.com/questions/5623436/svg-rendering-badly-in-firefox">SVG rendering badly in Firefox</a><br> <a href="https://stackoverflow.com/questions/11879836/firefox-not-anti-aliasing-scaled-background-svg">Firefox not anti-aliasing scaled background svg</a><br> <a href="https://stackoverflow.com/questions/8954028/firefox-svg-graphics-blurry">Firefox SVG graphics blurry</a></p> <p>Some suggestions were to not scale the SVG too much using <code>background-size</code> and to give it <code>width="100%" height="100%"</code>.</p> <p>I only scale the SVG by 5%, so that really shouldn't be too much. Adding <code>width="100%" height="100%"</code> was fixing the pixelation a bit, but its still <em>really</em> blurry compared to the other browsers.</p> <p><em>What helped</em> was this linked comment: <a href="http://coding.smashingmagazine.com/2012/01/16/resolution-independence-with-svg/#comment-573707" rel="nofollow noreferrer">http://coding.smashingmagazine.com/2012/01/16/resolution-independence-with-svg/#comment-573707</a></p> <p>Originally the width and height were 22px. Now I've set both to 200px and voilà, the SVG renders as crisp as it should - but now Opera renders it a bit blurred/really bad! Also, when zooming in, the graphic gets 'cut off'. So instead of scaling proportionally, the graphic seems to be upscaled in it's box. Is there any fix for that? </p> <p>The interesting thing is: As background image for a button, it renders blurred. As background image in an input field, it renders as "overly crisp" I would call it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload