Adding margins/padding for headings

Hey,

So I’ve been having some problems with paragraph spacing for my content. The margins were too large and I remedied this by just using shift+enter and doing a big block of text instead of paragraphs.

Anyway, this worked for a while, but I wanted to change. So I added this CSS in to change the margin and line-height for my content:

p {
  line-height: 1.66667em; 
  margin: 0 0 1.666666666667em;
}

This works great for my paragraphs.

But now I want to add some margin/padding for when I place headings. Because when I add a line of text after a heading the text comes immediately under with no space and it doesn’t look good.

So I want some separation/margins/paddings for my headings. I have been remedying this by adding a shift+enter line after each heading, but is there a better way?

Hope this makes sense.

Cheers.

Hi Mark,

Thanks for reaching out.

Do you mean when adding headline to text editor? For that, you’ll have to use the headline tag name. Example, let’s say

<h1> my title </h1>

Then the CSS would be

h1 {
  line-height: 1.66667em; 
  margin: 0 0 1.666666666667em;
}

If it’s h2, then the CSS should be for h2 to, and then so on :slight_smile:

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.