Jump to content

Remove padding inside code block

Recommended Posts

Is there a way to remove padding inside of a code block?

I've inserted an image using a Code block and want the block to fit snug around the image itself, but I'm getting an extra padding on all sides.

Here is a link to the site for reference
Password: weddings

This is the code I currently tried to use:


.sqs-block-code .sqs-block-content {
padding-top: 0px;
margin: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
}  

Any help would be much appreciated!

Edited by bpurnell
Initial Revision
Link to comment
  • 4 weeks later...
  • 7 months later...
7 hours ago, Mum-Folk said:

I'm having a similar problem - code block adds way too much padding below the content. Is there a CSS workaround? I tried the above and no luck

Try this CSS, it it doesn't work, please share link to your site to check

.code-block {
	padding: 0 !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 months later...
  • 3 months later...
  • 4 weeks later...
On 2/11/2021 at 9:28 PM, AmalieCharlesworth said:

Hi does anyone know how to do this exact feature without removing the border completely? I just want to reduce the size of the border by half!

thank you!!

Amalie

Can you share link to page where you have problem? We can help easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 11 months later...
  • 2 months later...
15 hours ago, HunterD said:

Did anyone  get the solution for  this problem? Remove padding inside code block, none of the codes above worked. Thanks!

Can you share link to page where you use Code Block? We can help easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 3/30/2022 at 10:03 AM, MillyBanks said:

https://sunflower-eagle-a3h3.squarespace.com/home

Having a similar issue with a custom code block. Lots of padding under the video!! In fact I can't seem to target the video specifically to edit anything (like I was able to with the text. I want to be able to bring the video in front of the text 'box' so it looks like the final screenshot and remove the white space under the video. 

 

438351657_Screenshot2022-03-30at04_01_01.thumb.png.cbd9b5bdb9ba13c84e28dcc7cc040f61.png

 

1044477193_Screenshot2022-03-30at04_01_30.thumb.png.5f87acc7744874db0bd79c0e4be3765c.png

1915499706_Screenshot2022-03-30at03_02_22.thumb.png.eb567d8ef4e277e092baf30022d44c99.png

Which page are you referring to? I don't see above text/video on the page

https://sunflower-eagle-a3h3.squarespace.com/home

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
10 hours ago, MillyBanks said:

Hi @tuanphan I had deleted the block as it wasn't working but it have popped the code back in if you want to take a look! 

https://sunflower-eagle-a3h3.squarespace.com/home

 

I would also like the video to appear in front of the text block but can't seem to make z-index work

Add this CSS

div#block-yui_3_17_2_1_1648605913394_9538 video {
    z-index: 99;
    position: relative;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 4/7/2022 at 4:23 PM, Iwan said:

Hi @tuanphan, is there a CSS to reduce the padding around one specific text block? Please?

Use this

#text-block-id {
	padding: 0px !important;
}

Use this tool to find block id https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 weeks later...
On 5/10/2022 at 7:32 AM, karenrosenfeld said:

Hi @tuanphan I am having trouble with this too. I've tried everything. There is so much padding around my text in my code block. Do you have a fix?

The "featured blogs" text

https://karenrosenfeld.com/karenrosenfeldcreative-1 

image.thumb.png.df459600f99a43e1fe12e6d88c5f4fac.png

Which page are you referring to? I don't see Featured Blogs on above page

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 months later...
  • 1 year later...

I have issues with this, please. Hi. I've been trying to fix this on my site
1.  Fixing spacing/padding  on my embedded opt-in form on the home page
2. Finding why some blogs are no longer showing on the website


I thought it would be a fairly simple CSS fix but it seems not to be that way. I'd like to roughly halve or remove the padding so that it matches the normal padding used throughout the page. The padding seems to be associated with the page section rather than the form itself.

Here's my website link: https://www.balancedbbs.com/

Looking forward to your help. Thanks!

PaddingIssue1.thumb.jpeg.c8673207006ecb527c508bd5d37e7304.jpeg

Paddingissue2.thumb.png.d85e44e0a9d14caa84263cbb1f61949d.png

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.