• My image captions are all aligned left which suits me fine (I can’t remember if that’s the default or whether I changed it) but occasionally I use an image which demands a centred caption and so I would like to be able to change the caption styling on a per image basis by adding some code to the Caption field in the Image Edit window.

    Most of the things I have tried have worked briefly but obviously displeased Big Brother because the next time I loaded the page, my caption code had been stripped out. Even inserting a few non-breaking spaces before the caption only worked for a short while.

    I think I was once able to make my styling stick when I wrapped the caption in p tags and centred it – but that gave me some fat padding at the front end so that the caption was too far removed from the image.

    So, is there a correct way to do this which Big Brother likes? I’m thinking I might be able to use CSS to address individual captions by ID but I would prefer just to insert some styling in the Image Editor. (Actually, it’s on my wish-list to have Alignment buttons for the caption in addition to Alignment buttons for the image.)

    PS. Some of my captions display wider than the mage they are attached to. I assume that’s because there is some default padding assigned to images which isn’t equally assigned to the captions. The result is that some of my captions are one character wider than the image which sounds like a small thing but it looks ugly on the page. Can I fix this in CSS? I’m already using the following CSS to move my caption text the desired distance away from the image…

    /* photo caption padding */
    .wp-caption img {margin-bottom: 0.6em;}

    …but when I try extending the margin to left and right or adding a padding property, the caption text simply changes from being one character too wide on the right to one character too wide on the left!

    Thanks for any guidance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Image caption styling’ is closed to new replies.