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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 5 months later...
On 9/15/2020 at 3:48 PM, Nankas said:

Does anyone have the answer to this?? Please

I sent above code. If it doesn't work, can you share link to page where  you use Code Block? We can check easier.

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 11 months later...
On 1/20/2022 at 9:27 AM, kakers said:

Did anyone solve this? The code didn't work for me.

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 5 months later...

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.