Jump to content

Increase and Decrease Spacing Before and After Heading in Blog Post Using CSS

Recommended Posts

Hello everyone. 

I posted this before and didn't quite get the answer I wanted. I want to increase or decrease the spacing on a heading in a blog post. I want to play with it until I get what I like. I've attached a screenshot with red arrows to show you experts what I'm talking about.

In the original post, someone responded advising me to use the spacer block. I don't want to have to manually do that every time I create a blog post. If someone can provide a CSS code that will save me a lot of time. Thanks in advance.

 

https://www.allamericanbullies.com/

 

 

Screenshot 2023-10-10 at 9.55.50 AM.png

Link to comment
24 minutes ago, yjchong said:

Hello everyone. 

I posted this before and didn't quite get the answer I wanted. I want to increase or decrease the spacing on a heading in a blog post. I want to play with it until I get what I like. I've attached a screenshot with red arrows to show you experts what I'm talking about.

In the original post, someone responded advising me to use the spacer block. I don't want to have to manually do that every time I create a blog post. If someone can provide a CSS code that will save me a lot of time. Thanks in advance.

 

https://www.allamericanbullies.com/

 

 

Screenshot 2023-10-10 at 9.55.50 AM.png

Do you want to increase and decrease spacing for each heading?

Screenshot_264.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
12 minutes ago, Web_Solutions said:

Do you want to increase and decrease spacing for each heading?

Screenshot_264.png

Yes, I'm assuming that once I add in the CSS it will automatically increase or decrease the spacing to my liking. I want to play with the spacing to get it to exactly what I like. Thanks!

Link to comment
15 minutes ago, yjchong said:

Yes, I'm assuming that once I add in the CSS it will automatically increase or decrease the spacing to my liking. I want to play with the spacing to get it to exactly what I like. Thanks!

 

This is the code for increase or decrease the spacing. For increase or decrease the spacing, change the value 20px to 30px or 10px or as you want.

Add these code on Custom CSS panel in Website Utilities Website Tools > Custom CSS.

.blog-item-content-wrapper .html-block {
  h3 {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
  }
  p{
    margin-top: 0 !important;
  }
  h3:first-child {
    margin-top: 0px !important;
  }
}

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.