0

So I have an <h2> element and a <p> right below it and I'd like to space them out a little bit. Currently I'm just using a <br> between them but I was wondering if there's a way to do it in CSS? It can be applied to all the <h2> and <p> elements on my page. Thanks!

1 Answers1

0

you can control line-spacing in one HTML tag only. So if you have

<h2 style="line-spacing:40px;">Hello World</h2>
<p>Lorem ipsum</p>

It will only affect the <h2> "Hello World" and not the <p> tag with the text Lorem Ipsum. You need to give the a margin-bottom such as this:

<h2 style="margin-bottom:40px;">Hello World</h2>
<p>Lorem ipsum</p>
user5854648
  • 1,029
  • 2
  • 11
  • 36