Title: Image Caption Issues
Last modified: August 22, 2016

---

# Image Caption Issues

 *  [Tom Ewer](https://wordpress.org/support/users/tomewer/)
 * (@tomewer)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/image-caption-issues/)
 * Hello,
 * I am creating a new design for an old site.
 * I’m having trouble with captioned images. Ideally images should have a little
   padding and a 1px border around them when aligned right. I’ve used the following
   CSS:
 * .alignright {
    border: 1px solid #c5c5c5; float: right; margin: 0 0 .5rem .5rem;
   padding: .2rem; }
 * However, when an image has a caption, there ends up being too much padding to
   the right of the image, which doesn’t look good: [http://dev.leavingworkbehind.com/about/](http://dev.leavingworkbehind.com/about/).
 * Any ideas how I can fix this?
 * Cheers,
 * Tom Ewer

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [grief-of-these-days](https://wordpress.org/support/users/grief-of-these-days/)
 * (@grief-of-these-days)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/image-caption-issues/#post-5418438)
 * That’s because the `div` around the image and caption has explicit width of _290px_
   which doesn’t match the image width. If you can change it to _280px_ you’ll get
   the desired behaviour.
 * P.S. The dirty way to fix this would be by adding `width: 280px !important;` 
   to `.alignright` class. But it’s better to fix the theme, methinks.
 *  Thread Starter [Tom Ewer](https://wordpress.org/support/users/tomewer/)
 * (@tomewer)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/image-caption-issues/#post-5418454)
 * You’re right. The problem is that I’m not setting that width.
 * In the text editor the code is:
 * `[caption id="attachment_6280" align="alignright" width="280"]`
 * On the front end the corresponding code is:
 * `<div id="attachment_6280" style="width: 290px" class="wp-caption alignright"
   >`
 * For some reason WordPress is turning 280px into 290px. Any idea why?
 * Thanks!
 *  [grief-of-these-days](https://wordpress.org/support/users/grief-of-these-days/)
 * (@grief-of-these-days)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/image-caption-issues/#post-5418461)
 * Well, this is beyond my understanding, but it looks like the width you set is
   _always_ increased by 10. x_x

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Image Caption Issues’ is closed to new replies.

## Tags

 * [caption](https://wordpress.org/support/topic-tag/caption/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [images](https://wordpress.org/support/topic-tag/images/)

 * 3 replies
 * 2 participants
 * Last reply from: [grief-of-these-days](https://wordpress.org/support/users/grief-of-these-days/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/image-caption-issues/#post-5418461)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
