WordPress.org

Support

Support » Themes and Templates » [Resolved] How to center image captions?

[Resolved] How to center image captions?

  • 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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try applying styles to the following classes:

    .wp-caption {
         /* Style definition for image container */
    }
    .wp-caption-text {
         /* Style definition for image caption */
    }

    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.

    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.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] How to center image captions?’ is closed to new replies.
Skip to toolbar