WordPress.org

Forums

Grisaille
[resolved] Widget Alignment (26 posts)

  1. breacher18
    Member
    Posted 2 years 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
    Forum moderator
    Posted 2 years ago #

    Provide a link to the problematic webpage.

  3. breacher18
    Member
    Posted 2 years ago #

  4. Andrew
    Forum moderator
    Posted 2 years 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 2 years ago #

    I have turned it off now if that helps

  6. Andrew
    Forum moderator
    Posted 2 years ago #

    Using !important on the end of the styles, add

    margin: 0 auto;
    display: block;

    on that <ins> element.

  7. breacher18
    Member
    Posted 2 years ago #

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

  8. Andrew
    Forum moderator
    Posted 2 years 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 2 years ago #

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

  10. Andrew
    Forum moderator
    Posted 2 years ago #

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

  11. breacher18
    Member
    Posted 2 years ago #

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

  12. breacher18
    Member
    Posted 2 years ago #

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

  13. breacher18
    Member
    Posted 2 years ago #

    Any help on this one please?

  14. Andrew
    Forum moderator
    Posted 2 years ago #

    Whereabouts are you adding the CSS modification?

  15. breacher18
    Member
    Posted 2 years ago #

    In the themes style.css

  16. Andrew
    Forum moderator
    Posted 2 years ago #

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

  17. breacher18
    Member
    Posted 2 years ago #

    Yes i tried those two bits of code didnt change anything

  18. Andrew
    Forum moderator
    Posted 2 years 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 2 years 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
    Forum moderator
    Posted 2 years 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 2 years ago #

    Should be there now.

  22. Andrew
    Forum moderator
    Posted 2 years 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 2 years ago #

    Done

  24. breacher18
    Member
    Posted 2 years ago #

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

  25. Andrew
    Forum moderator
    Posted 2 years 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 2 years ago #

    Thanks for are your help much appreciated :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic