Untitled theme – Change margin around images

  • Unknown's avatar

    I have been looking into the stylesheet for a long time, but have the following issue. The margin around the pictures in this theme is 30px (have found out by doing a “inspect element” in Chrome), but I want to decrease it. I want to decrease the margins a bit to get rid of some whitespace, but can’t find which setting changes this.

    Is there anyone who can help me with this?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    What gives the margin to pictures in your posts is this:

    .alignnone {
        clear: both;
        display: block;
        margin: 1.5em 0;
    }

    Particularly the margin: 1.5em part.

    To specify a custom CSS for only images with .alignnone class, and reduce the margin to zero, you can add:

    img.alignnone {
        margin: 0;
    }
  • Unknown's avatar

    Thank you, will try that out.

  • Unknown's avatar

    Yeah, I forgot to mention that .alignnone is automatically given by WP if you choose the image to not be aligned anywhere when posting the image.

    So if you choose different alignments for the image, that CSS will not apply. You can find the alignment option location on the third-to-last screenshot image, here:

    http://en.support.wordpress.com/images/image-settings/

  • Unknown's avatar

    The 30px isn’t a margin around images, it’s a margin below the post title. If that’s the space you want to decrease, start with this:

    .entry-title {
    margin: 0;
    }
  • The topic ‘Untitled theme – Change margin around images’ is closed to new replies.