• Hi,
    I am tweaking TwentyTen and stumbled on a problem..
    It seems that when inserting left-aligned pictures in pages WP adds: style=”width: 650px” to the image which means an extra 10 px to the image’s actual width. It doesn’t show in html-mode either as it does if you add margin in the advanced preferences for the image.
    Since it gets created directly in the page I can’t take it away in the style-sheet. It doesn’t make a change either to use negative margins in the style-sheet.

    The result creates a 10px space to the left of the picture.

    Where is it initiated? Any WP-guru out there to help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • afaik, this happens only for images with captions;

    https://www.transformationpowertools.com/wordpress/adjust-caption-frame-width

    can you post a link to your site to illustrate the problem?

    Thread Starter cesbloggan

    (@cesbloggan)

    Thanks!
    I read the post and copied the code into functions.php and it works like a charm!
    Of course it was an image with a caption but I want to have the possibility of using captions and not having to add extra code to format regular text like a caption.
    ??

    The extra 10px can also be removed using jQuery. The code below sets the .wp-caption container width to match the width of the image inside it:

    jQuery().ready(function() {
    	var width = jQuery(".wp-caption img").width();
    	jQuery(".wp-caption").width(width);
    	});

    See this thread.

    Actually this version is more solid:

    jQuery().ready(function( jQuery ) {
        jQuery(".wp-caption").width(function() {
            return jQuery('img', this).width();
        });
    });

    See this thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP adding style with extra 10px.. Where?’ is closed to new replies.