The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › No-repeat SVG with width?
https://codepen.io/Ayalann/pen/MmEQqM
Hi,
I want to put an svg before a text (see the example), and I want to put this all in the center. The problem is that if the width is 0, then a text is no in the center, but if the width is not 0, the svg is repeated.
How can I solve this problem?
So, if I understand correctly, you want the text in the center and then the logo to the left of that….right?
If you know the width of the span you can use background-position to fix that
span
background-position
http://codepen.io/Paulie-D/pen/rmGdLL
If you don’t know the width, then I’d suggest you use a positioned pseudo-element and put the logo as the backgroud of that.
http://codepen.io/Paulie-D/pen/YVraye