Why Does WordPress Add 10px to images with captions…
-
… and how can I stop it?
<div id="attachment_907" style="width: 1210px" class="wp-caption alignnone"> <img class=" wp-image-907" title="Image Alignment 1200x400" alt="Image Alignment 1200x400" src="https://localhost/WordPress/wp-content/uploads/2013/03/image-alignment-1200x40021.jpg" width="1200" height="400"> <p class="wp-caption-text">Massive image comment for your eyeballs.</p> </div>
Note the width of the image is 1200px but the div is having a “style” attribute inserted into it that is 1210px.
Where is this extra 10px coming from and how do I get rid of it? If I remove the attribute completely, it still will mess up some of the captions so I want the style to be set to the image width.
So far the only solutions I have seen is to hack the media.php file in the /wp-includes/ folder or to use a JavaScript solution. Neither of which is something I want to do since the latter can be avoided and the former is never a good idea IMO.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Why Does WordPress Add 10px to images with captions…’ is closed to new replies.