Support » Plugin: AddToAny Share Buttons » Centering Share Buttons In A Div

  • Resolved stumur

    (@stumur)


    Hi Guys,

    I’m awfully sorry to bother you, but I hope this is an easy question? I’ve read all the documentation, but can’t work this out. My WordPress website’s right sidebar is 222px wide. In it, I have room for 6 Addtoany share icons, which I’ve added, but even though the div itself is the full 222px sidebar width, the icons only total 216px width, which is fine, but they’re aligned hard on the left side of the div, so even though the div is full width, the icons are 6px off-centre to the left. I’ve tried using the “.addtoany_content { text-align:center; }” code into the Additional CSS code in the Settings tab, but nothing moves when I refresh the live page. I can’t live with the icons justified left when all the other div stuff is centered. I’m not great at this stuff.. Could you please help at all?

    Thanks SO much,
    Stu

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • stumur

    (@stumur)

    Argh.. Got it, by sheer fluke! The code for my theme needed to be slightly different to the suggested code above. This works:

    div{
    text-align:center;
    }

    Coding kills me.

    • This reply was modified 2 months ago by stumur.
    Plugin Author micropat

    (@micropat)

    Coding is sheer willpower. 🙂

    Since your div selector applies to all div elements, and you’re using the [addtoany] shortcode instead of the default buttons in content, it’s best to get more specific with your CSS code:

    .addtoany_shortcode { text-align: center; }

    stumur

    (@stumur)

    OMG! Micropat, you are a totes legend. Thank you so much! I spent two days on this and what I thought worked above ( div{ text-align:center; } ) ended up centering EVERYTHING on my site! Lol. But your suggestion is the one. I’m totally hopeless, but due to awesome guys like you, I’m hanging in there.. thanks so much – really. Coding – what radiation poisoning feels like, as far as I can tell. 😐

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.