Forums

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

Home Forums Other SVGs & WordPress

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #158482
    mintertweed
    Participant

    I have SVGs on my WordPress home page, here. If you scroll down, you’ll see my issue. To make sure that I was doing everything properly, I also created this mockup in CodePen using the same exact code. The mockup looks fine and is working properly except for the added four pixels of margin at the bottom of each SVG. I will give a virtual hug to anyone who can help me with making the SVGs appear properly on my WordPress website. Extra credit for the person who can figure out how to get rid of that four extra pixels at the bottom of the SVGs. Thanks in advance!

    Edit: I suspect this is an HTML problem, but I’m not entirely sure.

    #158484
    chrisburton
    Participant
    .social-widget {
        height: 32px; /* fixed */
        ....
    
    #158486
    mintertweed
    Participant

    Thank you, @chrisburton. I knew the extra space had to be something simple. I kept playing with margin and padding. I don’t know why it didn’t occur to me to mess with the height. Boo upon me. Now, I just need to figure out why WordPress won’t display the SVGs properly.

    #158488
    chrisburton
    Participant

    What do you mean? You mean where the RSS is above the rest? I think it has to do with the first icon (RSS).

    #158489
    mintertweed
    Participant

    I placed the SVGs in an img tag and everything is displaying properly except for the colors. Is there any way to place an SVG in a tag and retain control over the colors within the SVG?

    #158490
    mintertweed
    Participant

    @chrisburton, That’s after I placed the SVGs in img tags. Before, I was using the raw XML and it displays fine in CodePen, but not so much in WordPress. Now I have img src pointing to the SVG file, but I lose all control over the fill color when I do this.

    #158491
    chrisburton
    Participant

    I think the best way to handle this is with icon fonts. You can upload your own SVG and convert them to a font file with icomoon.io

    Just go here: http://icomoon.io/app/

    Then, choose import.

    #158493
    mintertweed
    Participant

    Interesting. After I do that, would I then use @font-face? And control the encapsulating area with basic CSS?

    #158496
    chrisburton
    Participant

    Exactly.

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