[Resolved] Decreasing the space below headers

  • Author
    Posts
  • #5802

    draesimpson
    Participant

    Hello – I would like to decrease the amount of whitespace (or padding) appearing below/above my H1, H2, H3 tags. Is this possible using custom CSS? Would also like to decrease the space between paragraph text when I enter down.

    Any feedback is greatly appreciated. Thanks!

    #5804

    Andrew Misplon
    Keymaster

    Hi 🙂 Thanks for reaching out. Sure, you can try:

    .entry-content h1,
    .entry-content h2,
    .entry-content h3,
    .entry-content h4,
    .entry-content h5,
    .entry-content h6 {
    	margin: 0;
    }
    #5805

    draesimpson
    Participant

    Thanks for the feedback Andrew! That works, however, it eliminates the space altogether. I just wanted to decrease it a bit.

    Am I locked in to only using 1 or 0? I tried 0.5 and it didn’t work

    .entry-content h1,
    .entry-content h2,
    .entry-content h3,
    .entry-content h4,
    .entry-content h5,
    .entry-content h6 {
    margin: 0.5;
    }

    Thanks!

    #5806

    Andrew Misplon
    Keymaster

    Ahh sorry for not mentioning that. In CSS only line-height can be unitless. So you can change 0 to whatever value you’d like but need to add a unit of measurement. For example: 25px;

    .entry-content h1,
    .entry-content h2,
    .entry-content h3,
    .entry-content h4,
    .entry-content h5,
    .entry-content h6 {
    	margin: 25px 0;
    }

    That means, 25px top and 25px bottom margin. You can also say:

    .entry-content h1,
    .entry-content h2,
    .entry-content h3,
    .entry-content h4,
    .entry-content h5,
    .entry-content h6 {
    	margin: 0 0 20px 0;
    }

    That’s easier to understand, the first value is top then right then bottom then left.

    #5813

    draesimpson
    Participant

    Thanks Andrew! That helped immensely! Much appreciated.

    #5814

    Andrew Misplon
    Keymaster

    Super 🙂 Glad to hear you’ve made progress.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Scroll to top