Need Help with Image Spacing

by 8 replies
9
Hi, I'm having a problem with an image on a wordpress site. I have it aligned to the left, with no border, and the text is wrapped around it. Problem is I want a little more space between the image and the text.

I've tried using the advanced settings to add a extra pixels to the horizontal space, but when I do that it automatically adds space to the vertical space, also. Is this normal?

Anyway, no matter what I do with the advanced settings, I can't get any extra space where I need it.

What am I doing wrong?
#website design #image #padding #spacing
  • No way to know for sure without seeing the page. What's the URL?
  • Hi,

    You can use css margin-left and margin-right or padding-left, padding-right.
    • [1] reply
    • Can you please give the exact code for padding right? If I wanted 20 pixels, do I just put "padding-right: 20" ?
      • [1] reply
  • This should do it:

    Code:
    img.alignleft{
        margin:0;
        padding:0 20px 0 0;
    }
    The first line resets the margins to zero. The second line is the shorthand padding setting. Values are read like a clock face. Starting at 12 o'clock then around clockwise to 3, 6, 9 (padding:Top Right Bottom Left)

    So, 20px for right and 0 for top, bottom and left.

    Or, in long form, this will do the same:

    Code:
    img.alignleft{
        margin:0; //zero out margins
        padding:0; //zero out padding
        padding-right:20px; //sets right side padding to 20 pixels
    }
    I'm zero'ing the margins and padding to eliminate any conflicts with your existing css rules. You can place this at the bottom of style.css (or at the bottom of the last stylesheet included in your theme)
    • [ 1 ] Thanks
    • [1] reply
    • Thanks, Scott, for your lengthy reply, but I only need something for one post. Aren't your instructions for a site-wide fix? And the wordpress coding already indicates that it's aligned left.

      Anyway, I've rearranged some text so it looks better.
      • [1] reply
  • if you want to get a better answer to question, just post the actual url..

Next Topics on Trending Feed

  • 9

    Hi, I'm having a problem with an image on a wordpress site. I have it aligned to the left, with no border, and the text is wrapped around it. Problem is I want a little more space between the image and the text. I've tried using the advanced settings to add a extra pixels to the horizontal space, but when I do that it automatically adds space to the vertical space, also. Is this normal?