WordPress.org

Support

Support » Themes and Templates » [Resolved] Inserting image causes vertical space before H2 heading

[Resolved] Inserting image causes vertical space before H2 heading

  • I’m using a fairly simple child of the TwentyTen theme on my site, and I find when I insert a right-justified image, the text only flows down the left side of the image until the next H2. Then a large vertical space is inserted before the next H2. You can see an example here.

    The weird thing is, the Visual post editor displays what I expect: the text continues flowing down the left side of the image with no vertical space. It’s only when the post is viewed on the site that it looks ugly.

    Anyone have any clue what might be causing this?

    Thanks,
    Graham

Viewing 2 replies - 1 through 2 (of 2 total)
  • WPyogi

    @wpyogi

    Forum Moderator

    Heading tags have “clear: both;” CSS assigned here:

    h1, h2, h3, h4, h5, h6 {
        clear: both;
        font-weight: normal;
    }

    This means that they clear any previously floated elements – or start below the element. You could change that in the CSS (might have other problematic effects however) or add a CSS class that would only apply it to certain elements – perhaps something like:

    .noclear {
       clear: none;
    }

    Then assign that class to any headings that you do not want to clear the above floated elements.

    Thanks WPyogi. You’re awesome! Problem solved. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Inserting image causes vertical space before H2 heading’ is closed to new replies.
Skip to toolbar