If you don’t mind poking around in the php, you can change this width- I had the same problem and found the culprit at line 375 of media.php:
return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">'
Just change ’10’ to whatever pixel width addition you require. None, in my case.
This should really be configurable in the editor, though, I agree.
Ciao!
I totaly agree that the addition of this style-rule is agaist all good practices of seperating form and content.
Let’s hope its a bug that will be removed from media.php soon.
For now, I deleted the entire style-rule from the php-code. Now I hope I’ll remember to check on media.php everytime I upgrade WP.
I’m not seeing the entry in media.php that adds the 10px. Perhaps I’m missing something. I’m using wordpress 2.6.3
I just found this and am also annoyed. The thing I’d point out is that, for floated elements, it’s a requirement of the CSS2 spec that an explicit width be specified, so WordPress is doing the right thing by specifying a width. However, hardcoding the extra 10px being added on deep in the application is totally braindead!
I would definitely mark this as a bug until it’s removed. Here’s a patch to fix it:
--- media-old.php 2008-11-21 18:01:11.000000000 -0800
+++ media.php 2008-11-21 18:01:38.000000000 -0800
@@ -372,7 +372,7 @@
if ( $id ) $id = 'id="' . $id . '" ';
- return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">'
+ return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . (int) $width . 'px">'
. $content . '<p class="wp-caption-text">' . $caption . '</p></div>';
}
I wrote a little bit more about the CSS requirement on this bug report:
http://ww.wp.xz.cn/support/topic/189254