WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when I insert an image into a post, the <div> that contains that image (and thus any caption) is set to be wider that the image itself.

For example, I have added an image that is 211px wide. The <div> that houses the image has an element style of 221px.

Is there a way, other than using javascript, to remove that, and have the box of equal width to the containing image?

share|improve this question
up vote 1 down vote accepted

something I wrote a while ago: 'Adjusting Caption Frame Width'

share|improve this answer
Well done Squire. It's mental that this even happens. – Mild Fuzz Sep 9 '11 at 20:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.