Forums

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

  1. BlondeCroatian
    Member
    Posted 3 months 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 3 months 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 3 months 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 3 months 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 3 months 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 3 months 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 Nevins
    Volunteer Moderator
    Posted 3 months ago #

    Amend Alchymyth's code to this;

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

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

Reply

You must log in to post.

About this Topic