Support » Fixing WordPress » Remove spacing between vertically stacked images

  • You can easily see the problem here:

    We made a few images that would look best if they were stacked directly on top of eachother. Instead you have that spacing, and it kind of ruins the image to the right of the text, which is our logo.

    It should look more like this:

    In the editor, there is no spacing. Only when I publish and view it on the website does it show the spaces.

    Any ideas how on to remove the spacing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • It is coming from the .alignleft class in your style.css

    See the disabled style in the bottom right of this screenshot:

    The .alignleft class that is sort of packaged with WordPress applies a 6px margin to both the top and bottom of whatever element the class is applied to.

    To remove the spacing, possibly you might like to apply your own class to the image and create your own CSS rule that would remove the margin. You could also override the CSS rules in perhaps a child theme. Many solutions, choose what works best for you. However, I would caution against adding/removing/modifying the rules associated with .alignleft because they are applied automatically by the visual editor, regardless of what element they are being applied to. In short, that may cause more issues than you fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove spacing between vertically stacked images’ is closed to new replies.