WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Center image in text widget (13 posts)

  1. BlondeCroatian
    Member
    Posted 1 year ago #

    I would like to center the badges under my "Awesomeness" text widget in my sidebar.

    By viewing my source code, I've found that the widget ID is called "text-5" and the class is "widget widget_text".. and I've been trying to use different variations of this code to center the images:

    #text-5 widget_text {
    text-align: center;
    }

    I just can't get it to work. Any ideas?

    My site is http://tacklingmommyhood.com

  2. leejosepho
    Member
    Posted 1 year ago #

    This might be a bit simplistic, but this is how I center something right there inside a text widget:

    <p style="text-align: center;">
    our e-mail address<BR>
    <a href="mailto:info@yoursite.xyz" title="mailto:info@yoursite.xyz">info@yoursite.xyz</a></p>
  3. BlondeCroatian
    Member
    Posted 1 year ago #

    I just tried putting <p style="text-align: center;"> before all of the text in my text widget and then a </p> after all of the text, and nothing :(

  4. leejosepho
    Member
    Posted 1 year ago #

    Maybe there is something different about our themes, or maybe you just need to check "Automatically add paragraphs" at the text widget if you have that option and have not already done so.

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    try:

    #text-5.widget_text { text-align: center; }

    or:

    #text-5.widget_text .textwidget { text-align: center; }

    and clear the browser cache after the changes - press 'ctrl f5' or 'reload' ...

  6. BlondeCroatian
    Member
    Posted 1 year ago #

    alchymth, that did the trick (the first one)! but it also centered the title.... do you know how to make it center the items under the title and not the actual widget title?

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    Amend Alchymyth's code to this;

    #text-5.widget_text .textwidget {
     text-align: center;
    }
  8. BlondeCroatian
    Member
    Posted 1 year ago #

    Andrew Nevins, thank you thank you thank you!!!!!! That worked!!!!

  9. TreeSpaulding
    Member
    Posted 1 year ago #

    Hi,
    I'm having the same problem and don't know how to put this all together with the image info.
    Thanks

  10. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    @TreeSpaulding - This thread is marked resolved and CSS is theme/site specific. Please start your own thread if you need help.

  11. esmi
    Forum Moderator
    Posted 1 year ago #

    @TreeSpaulding: As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem - despite any similarity in symptoms - is likely to be completely different.

  12. TreeSpaulding
    Member
    Posted 1 year ago #

    Whoops. Thanks! I'm learning!

  13. Andrew
    Forum Moderator
    Posted 1 year ago #

    No worries.

Topic Closed

This topic has been closed to new replies.

About this Topic