Jump to content

Extra spacing around code blocks

Go to solution Solved by Lesum,

Recommended Posts

Posted

Hello, 

I've having a bit of a spacing issue. 
https://houseofbubbles.squarespace.com/the-bubbles-bar/
password: bubbles

In the 'Upcoming Events' section, I've added code blocks to represent each date and location of an event. Using a Classic Editor Section. When i preview the site in the Squarespace editor there is no extra space. However when I preview the page in a browser, there is a lot of extra space under each code block - how can I remove this?

Also, on mobile, how can I get 3 code blocks to display per row, rather than stacked full width on top of each other?

Have attached screenshots for reference. Thank you
 

SS-Browser.jpg

SS-Editor.jpg

SS-Inspector.jpg

  • Solution
Posted

@holahannah You can add this code snippet within the Custom CSS panel to remove the extra spacing:

#cal-event h5 {
    margin-top: 0 !important;
}

section[data-section-id="650cba9ed255611c33fb9a3f"] .sqs-layout:not(.sqs-editing) .sqs-row+.sqs-row .sqs-block:not(.float):first-child {
    padding-top: 0px !important;
}

section[data-section-id="650cba9ed255611c33fb9a3f"] .sqs-layout:not(.sqs-editing) .sqs-row+.sqs-row .sqs-block:not(.float):first-child:last-child {
	padding-bottom: 0px !important;
}

@media screen and (max-width: 767px) {
	section[data-section-id="650cba9ed255611c33fb9a3f"] .sqs-layout .sqs-row .sqs-block:last-child {
		padding-bottom: 0px !important;
	}
	section[data-section-id="650cba9ed255611c33fb9a3f"] .sqs-layout .sqs-row .sqs-block:first-child {
		padding-top: 0px !important;
	}
}

To display three rows on mobile:

@media only screen and (max-width: 767px) {
	div#page-section-650cba9ed255611c33fb9a3f .row .sqs-col-12 {
		display: grid !important;
		grid-template-columns: 1fr 1fr 1fr !important;
	}
	#cal-event h5 {
		padding: 6% !important;
	}
}	

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Posted

Amazing! Thanks so much @Lesum. I applied that code and it worked! 

For the mobile, it looks good now displaying in 3 columns, however do you know if there is a way for the columns to read left to right, not vertically. 

Eg, the dates should read (right to left) Fri 30 June, Sat 1 July, Sunday 2 July  - rather than vertically as they currently are. 

Thank you!

Screenshot 2023-09-26 at 3.18.16 pm.png

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.