E
E
Egor Lavrenov2018-03-14 10:38:28
css
Egor Lavrenov, 2018-03-14 10:38:28

Problem with Svg in Firefox?

This is how it is displayed in FireFox
5aa8d0f054213791654109.png
This is how it is displayed in Opera and Chrome
5aa8d10f1cf01464276472.png
In firefox, the cart icon is incorrectly displayed, and the ruble icon is not displayed at all
At the expense of the cart icon, the feeling that FireFox ignores the viewbox of the svg element.
I insert through the use tag
What could be the problem?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
O
Odisseya, 2018-03-14
@EgorWeb

In the cart symbol, remove the width & height attributes to get:

<symbol id="svg-shoping-cart"  viewBox="0 0 118.08 96.5">
So, the icon will be scaled to the size of the container. To limit the size of the icon, specify it in <svg>, and then, if you need a custom size, override it via css.

A
Alexander Talalaev, 2018-03-14
@neuotq

Most often the problem is that the width and height parameters of the viewport are not set.
Not necessarily in pixels, and in general this does not restrict further scaling of the svg through css or otherwise, but allows many browsers to correctly calculate the image dimensions.

E
Egor Lavrenov, 2018-03-14
@EgorWeb

I am attaching the codepen https://codepen.io/SkuvaWeb/pen/pLgBZy

A
Alexey Zakharov, 2018-03-14
@konratnox

remove the inline width of the cart icon #svg-shoping-cart

B
BoBiKs, 2018-03-14
@BoBiKs

https://codepen.io/anon/pen/RMaNVB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question