WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Center image in text widget

[Resolved] Center image in text widget

  • 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

Viewing 12 replies - 1 through 12 (of 12 total)
  • 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>

    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 🙁

    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.

    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’ …

    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?

    Amend Alchymyth’s code to this;

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

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

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

    WPyogi

    @wpyogi

    Forum Moderator

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

    esmi

    @esmi

    Forum Moderator

    @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.

    Whoops. Thanks! I’m learning!

    No worries.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Resolved] Center image in text widget’ is closed to new replies.
Skip to toolbar