WordPress.org

Ready to get started?Download WordPress

Forums

Grisaille
[resolved] Widget Alignment (26 posts)

  1. breacher18
    Member
    Posted 1 year ago #

    Hi,

    Please can you help me I'm trying to get the Ad in my sidebar which is a widget to align in the centre rather than the left.

    Thanks

  2. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Provide a link to the problematic webpage.

  3. breacher18
    Member
    Posted 1 year ago #

  4. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Consider this article on centring things
    http://www.w3.org/Style/Examples/007/center.en.html

    By the way, the snow plugin was preventing me from debugging the issue.

  5. breacher18
    Member
    Posted 1 year ago #

    I have turned it off now if that helps

  6. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Using !important on the end of the styles, add

    margin: 0 auto;
    display: block;

    on that <ins> element.

  7. breacher18
    Member
    Posted 1 year ago #

    Is this in the sidebar.php or the style.css?

  8. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Does that theme come with a section of the dashboard named, "Custom CSS", "Custom Styles" or "Jetpack", or are you using a Child Theme?

  9. breacher18
    Member
    Posted 1 year ago #

    Yeh custom CSS. I have a child theme and also a plugin for custom CSS though.

  10. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    You can add the CSS to either your Child Theme style.css or Custom CSS section of the dashboard.

  11. breacher18
    Member
    Posted 1 year ago #

    Ok I will give it a go and let you know.

  12. breacher18
    Member
    Posted 1 year ago #

    No joy, but I don't think I'm adding it to the right place :/

  13. breacher18
    Member
    Posted 1 year ago #

    Any help on this one please?

  14. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Whereabouts are you adding the CSS modification?

  15. breacher18
    Member
    Posted 1 year ago #

    In the themes style.css

  16. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Have you tried the recommended Jetpack plugin, with its Custom CSS functionality?

  17. breacher18
    Member
    Posted 1 year ago #

    Yes i tried those two bits of code didnt change anything

  18. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    I can't find the CSS being applied to your webpage.
    Here's a guide of using the Custom CSS section of Jetpack http://jetpack.me/support/custom-css/

  19. breacher18
    Member
    Posted 1 year ago #

    I added the following to the custom css

    ins {margin: 0 auto;
          display: block;
          align: centre;}

    Still didn't change the element.

  20. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    I still don't see that CSS applied to the webpage. I think there's something wrong with the method you're using to apply the CSS.

    In an earlier post, I mentioned using !important on the end of your styles.

    Align is not a CSS property.

  21. breacher18
    Member
    Posted 1 year ago #

    Should be there now.

  22. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Yes, the CSS is being applied to the page.
    Use !important on the end of your styles, E.g;

    ins {
     margin: 0 auto !important;
     display: block !important;
    }
  23. breacher18
    Member
    Posted 1 year ago #

    Done

  24. breacher18
    Member
    Posted 1 year ago #

    Yay It has worked, what do the !important bits do then?

  25. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    They take precedence over other styles, that may be being applied through more specific selectors or inline. In your case, you had styles being applied inline. The !important bit should only be used if absolutely necessary.

  26. breacher18
    Member
    Posted 1 year ago #

    Thanks for are your help much appreciated :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic