Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS No-repeat SVG with width?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #254530
    Ayala
    Participant

    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?

    #254535
    Paulie_D
    Member

    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

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.