How to lose double line space before or after headings with HTML

  • Unknown's avatar

    I’m posting an HTML solution I couldn’t find anywhere, and worked it out myself.

    I read that using headings (<h2>, etc) helps with SEO, so I changed the <span…> formatting I’d used to h2 and 3. But that adds a double line space before and after the heading.

    Where I had a repeated section heading (in body text) above the heading, and a section contents list below the heading, the automatic double line spaces above and below the “h” heading looked wrong. I couldn’t find any HTML forum help with this. I don’t have CSS. I eventually found that this ‘style=”margin…’ coding works:

    <h2 style=”margin-top:-21px; margin-bottom:7px”>Heading</h2>

    I think the (WordPress.com) style text is 21px. (I’m not sure.) I had to experiment with the px numbers.

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

  • Unknown's avatar

    That got sent accidentally while I was trying to add tags. I was going to click the box for not needing help. I thought my post might help someone else trying to do the same thing without css. (Many posted solutions seem to assume the availability of css.)

    This is an example:

    Racism explained as a redundant instinct

  • The topic ‘How to lose double line space before or after headings with HTML’ is closed to new replies.