Jump to content

Padding around a line block

Go to solution Solved by MAC1,

Recommended Posts

Hi,

I've been playing around with padding/spacing a line under text. Issue is the line padding changes depending on size of screen. 
I was wondering if there was some universal css code for the line block so its always has the same padding top and bottom. keeping everything well spaced to the desired design.

not sure if something like this would work, just need to target the line block if i knew the right targeting.

/* Apply padding to Line blocks */
.sqs-block-line {
    padding-top: 50px; /* Adjust as needed */
    padding-bottom: 50px; /* Adjust as needed */
}



web: https://ellipse-teal-dl5w.squarespace.com/design/glitch-mx
pass: 2

thanks

some extra information just in case below--

full width line padding between text is fine:

line_padding1.thumb.png.c62848feb687eb17b82839236540e4a2.png

half width page line padding reduces more on top than bottom

line_padding2.thumb.png.b67eb16bc91016523682d3f6a7cb718f.png

reduce more and line goes too close to top title:

line_padding3.thumb.png.3e1c28ca201dda5545cd054bb1ed5bc4.png

Link to comment

This isn't the padding, it's the way that the rows react responsively when you adjust the viewport size. Since you have the line block and text block partially overlapping they don't react to each other. I would suggest removing any overlap, and tweaking the alignment of the text blocks to bottom aligned for the top text block, and top aligned for the bottom text block, and the line block center aligned.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • Solution
/* Apply padding to all Line blocks */
.sqs-block-horizontalrule   {
    padding-top: 20px !important; /* Adjust as needed */
    padding-bottom: 20px !important; /* Adjust as needed */
}

I found something that works its ".sqs-block-horizontalrule" targets all lines

with proper alignment text top (bottom alignment), line (middle align), bottom text (top align) , the line spacing stays the same with the padding code attached. thanks @Ziggy
 

Link to comment
  • 1 year later...

@Ziggy I'm having a similar issue with lines and hoping you might be able to help? I've used code blocks to create vertical lines on my site for a grid effect. This generally works great, but I've discovered that in instances where I want them to meet up with a horizontal line block, I can't get them to be flush (see screenshots). In section settings, I have fill screen toggled off and have taken the grid gaps down to zero hoping that would help. I've tried all combos of top, center, and bottom-aligning the horizontal lines.

https://newnewshapesstudio.squarespace.com/?password=ellen

I assume there's a way to move the line pixel by pixel with CSS but I'm not sure how to do it!

Thanks so much in advance.

Screenshot 2024-09-10 at 4.23.52 PM.png

Screenshot 2024-09-10 at 4.23.42 PM.png

Screenshot 2024-09-10 at 4.23.25 PM.png

Link to comment
8 hours ago, ellen_b said:

I assume there's a way to move the line pixel by pixel with CSS but I'm not sure how to do it!

I would suggest removing the margin from the line block:

.sqs-block-horizontalrule hr {
    margin-block-start: 0px !important;
    margin-block-end: 0px !important;
}

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
25 minutes ago, ellen_b said:

@Ziggy YES! That's perfect. Thanks so much!

No problem!

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.