WordPress.org

Ready to get started?Download WordPress

Forums

Style Sheet looks correct (to me) but image captions won't align (10 posts)

  1. wurliuchi
    Member
    Posted 3 years ago #

    I'd appreciate some advice. Can someone please and tell me why the captions under the photos in this post (not the sidebar) won't align to center?

    Also, a bonus question. How can I get space between the two photos and between the last photo and the last paragraph? You can see I typed in a period to get the space but that looks dumb. But If I add margins in the Advanced Edit Image box, the captions just get further away from the picture. I want the margin to apply to the div the picture and the caption are in. Know what I mean?

    Thanks for helping a beginner. I'm helping my friend with her site.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try adding text-align: center; to:

    .wp-caption p.wp-caption-text {
        font-size: 11px;
        line-height: 17px;
        margin: 0;
        padding: 0 4px 5px;
    }

    in style.css.

  3. wurliuchi
    Member
    Posted 3 years ago #

    I tried showing the CSS for the captions that's in the Style Sheet already, but it was moderated out. I must have done something wrong. I'll try again.

    Here's what in the style sheet for captions:

    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    Don't post CSS here. Without the context of the site, it's useless. And any more than 10 lines will be removed.

    I've already examined your style sheet on your site and you need to add the CSS I suggested.

  5. wurliuchi
    Member
    Posted 3 years ago #

    Oh, sorry.

    Now I understand what you were telling me, and I added that line to the CSS and it worked perfectly. Thank you so much.

    I think I have an idea of how to do the margins now, too. Not 100% sure, though.

    Thanks again.

  6. wurliuchi
    Member
    Posted 3 years ago #

    I can't figure out where to adjust the margin to get more space between the photos, and between the last photo and the last paragraph. Everything I try just puts more space between the image and the caption.

    If at all possible, I would appreciate some help with that.

    Thanks!

  7. esmi
    Forum Moderator
    Posted 3 years ago #

    Try changing:

    img.aligncenter, div.aligncenter {
        margin: 0 auto;
        text-align: center;
    }

    to:

    img.aligncenter, div.aligncenter {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    in style.css.

  8. wurliuchi
    Member
    Posted 3 years ago #

    Thanks, I will try that soon. But now, all of the sudden, the caption is not aligned center anymore. It was. I swear it was. But now it's back to how it used to be.

    Hmmm? This could be frustrating if I let it get to me.

    Thanks!

  9. wurliuchi
    Member
    Posted 3 years ago #

    Oh, I figured it out. I accidentally deleted a semicolon from the line above.

  10. wurliuchi
    Member
    Posted 3 years ago #

    Try changing:

    img.aligncenter, div.aligncenter {
    margin: 0 auto;
    text-align: center;
    }

    to:

    img.aligncenter, div.aligncenter {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    }

    in style.css.

    This is an edit: I said before that didn't help, but it did help some.

    How can I increase the margin when I want more vertical spacing between photos and between photos and other elements? I don't necessarily want more spacing all the time, but in some posts I would like to be able to adjust it.

    Thanks again for getting the center alignment to work on the caption. That saves me a lot of time and trouble.

Topic Closed

This topic has been closed to new replies.

About this Topic