WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to center image captions? (5 posts)

  1. emilyinchile
    Member
    Posted 3 years ago #

    I've done some searching and can't find a solution to this problem. I have a post with images that I want to caption. In the editor the captions look fine, but when I preview the captions aren't centered under the images - they just look like I typed normal text between two images.

    The only occurrence of the word "caption" in my Stylesheet is:
    .tr-caption-container {padding:5px 0 10px;font-size:11px;font-style:italic;}
    span br {display:none}
    .comment-body br {margin-bottom:10px;}

    I tried the advice in this post, but adding the suggested HTML after the HTML I just posted didn't help.

    Any ideas? I'm a total newbie, so any help is much appreciate. Blog is http://www.emilyinchile.com/ if that helps. Thanks!

  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Try applying styles to the following classes:

    .wp-caption {
         /* Style definition for image container */
    }
    .wp-caption-text {
         /* Style definition for image caption */
    }
  3. emilyinchile
    Member
    Posted 3 years ago #

    Thanks a lot.

    In the end, someone else was able to take a look at it IRL and added

    .post p.wp-caption-text {text-align:center;padding:3px;background-color:#eee;border:solid 1px #999;font-size:11px;}
    .aligncenter {text-align:center;margin:0 auto;}

    to the end of the Stylesheet, in case that helps anyone.

  4. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    Glad you got it worked out!

    p.s. be sure to mark the thread as "resolved" if your issue has been resolved, in order to facilitate others who may need to find solutions to similar issues.

  5. emilyinchile
    Member
    Posted 3 years ago #

    Thanks for the tip, I'll change the status of the thread now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags