M
M
MegaPuxapb2020-09-21 17:27:08
css
MegaPuxapb, 2020-09-21 17:27:08

svg alignment?

Insert svg icon from sprite.
how to press it to the left edge without setting a fixed width of the svg (there are several icons, they have different widths)?

<svg>
   <use xlink:href="img/sprite.svg#payment1"></use>
</svg>

5f68b7450075d577440460.jpeg
5f68b7d00578a440733990.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Softlink, 2020-09-21
@Softlink

Here you can try to set the attribute only for symbols preserveAspectRatio="xMinYMin".
The character in the sprite will look something like this:

<svg xmlns="http://www.w3.org/2000/svg">
    <symbol id="payment1" viewBox="0 0 48 48" preserveAspectRatio="xMinYMin">
      <path d="M24,0C10.745,0,0,10.746,0,24c0,13.255,10..."/>
    </symbol>
</svg>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question