Guest Posted March 23, 2014 Share Posted March 23, 2014 (edited) Hi, I have pretty basic knowledge of CSS and have been able to do some tweaking so far, but I can't figure this one out and I've searched all through the forums but no luck: Is there any way to reduce the padding between blocks? Right now it looks like there's 10px or so space between all blocks (image, text, quote, etc.) and I'd just like to be able to get my elements closer together. I feel like this should be a simple fix but can't seem to find how to define the command. Thanks! Edited March 23, 2014 by Guest Link to comment
Solution Guest Posted March 23, 2014 Solution Share Posted March 23, 2014 Hoorah! After hours of searching and finally asking the question, I figured it out! Just sharing for anyone else looking to accomplish this. The CSS to define the blocks is ".sqs-block". At margin of 0px you get the default so you have to set the margin to negative values. So basically: .sqs-block { margin-left: -10px; margin-right: -10px; margin-top -10px; margin-bottom: -10px; } NOW...keep in mind you have to do the right AND left (or top and bottom) so one block doesn't force the other to the default position. This will also reduce outside page margin so if you want to keep that wider than the space between boxes you need to increase the page margin in the style editor by the same amount you decreased in your css (i.e. +10 in this example). Hope it helps! Link to comment
MickeyArdell Posted October 7, 2014 Share Posted October 7, 2014 Just wanted to follow up on this, if you do do it include the following code: html, body { max-width: 100%; overflow-x: hidden; } This will prevent the website scrolling horizontally at all. alpalbents, pramirol and Guillermiiiin 2 1 Link to comment
SChan Posted January 7, 2016 Share Posted January 7, 2016 @Socialitestyle & @MickeyArdell, Where did you insert this piece of code ? I tried both the Settings->Advanced for an individual page and the Design->Custom CSS and neither did anything. I too would like to make those spaces smaller between blocks. Link to comment
Guest Posted January 7, 2016 Share Posted January 7, 2016 Yes, I need this assistance as well! Thank you! Link to comment
SChan Posted January 8, 2016 Share Posted January 8, 2016 @Channon, I figured out how this works. Put this code in the Settings>Advanced page. It looks like this : <style> .sqs-block { margin-left: -30px; margin-right: -30px; margin-top -30px; margin-bottom: -30px; } < /style> (Get rid of the space between the "<" and the "/" in the closing "style"). I had to increase the number from -10 to -30 to really notice the difference. The code that MickeyArdell provided helps if you see a horizontal scroll bar and that goes in the Design>Custom CSS page. It should look like this : div { max-width: 100%; overflow-x: hidden; } Link to comment
lcairns Posted January 10, 2016 Share Posted January 10, 2016 @Channon I tried using your code above and it says there's a syntax error on line one (referring to the Link to comment
SChan Posted January 14, 2016 Share Posted January 14, 2016 @Channon, did you go all the way to Settings->Advanced->Code Injection and put it in the Header? Link to comment
SChan Posted January 14, 2016 Share Posted January 14, 2016 Also, if you may have to adjust the right & left numbers as I've found the blocks to be too close together.. I just deleted the right & left margins to get what I wanted Link to comment
odyboards Posted March 22, 2016 Share Posted March 22, 2016 (edited) This worked for me!Note: There's a syntax error on line 4, it's missing a colon margin-top: -10px; Edited March 22, 2016 by odyboards Initial Revision Link to comment
Guest iamme123 Posted July 1, 2016 Share Posted July 1, 2016 @socialitestylePlease fix the missing colon after "margin-top" when you get a chance for users that may not notice why the code isn't working when they first paste it in! :) Link to comment
rcosta Posted August 30, 2016 Share Posted August 30, 2016 For padding between Product Blocks I would like to share the code below: .sqs-block-product { padding-left: 0px !important; padding-right: 0px!important; Link to comment
Guest iamme123 Posted November 11, 2016 Share Posted November 11, 2016 There are missing colons in the answers above, try this: .sqs-block { margin-left: -30px; margin-right: -30px; margin-top: -30px; margin-bottom: -30px; } Link to comment
ntdes Posted August 20, 2017 Share Posted August 20, 2017 I created a block with custom html and now I want to apply css to reduce the padding between my blocks. However, since the custom code option isn't like a text editor, I don't now how to add the css code suggested above to my html code on my square space page. Any suggestions? Link to comment
grnenvy Posted February 25, 2018 Share Posted February 25, 2018 (edited) The top answer didn't work for me without adding style tags. The complete code that worked for me is: <style> .sqs-block { margin-left: -30px; margin-right: -30px; margin-top: -30px; margin-bottom: -30px; } </style> Edited February 25, 2018 by grnenvy Link to comment
jlama Posted August 19, 2020 Share Posted August 19, 2020 Will this work on mobile too? Link to comment
alpalbents Posted June 22, 2021 Share Posted June 22, 2021 On 10/7/2014 at 11:29 AM, MickeyArdell said: Just wanted to follow up on this, if you do do it include the following code: html, body { max-width: 100%; overflow-x: hidden; } This will prevent the website scrolling horizontally at all. @mickeyardell what can I do for my site that is experiencing vertical scrolling in the footer, after restricting the margin between blocks? I want the max height to be the same as the instagram and the footer bar. https://www.moonvalleydesign.co/ Link to comment
tuanphan Posted June 24, 2021 Share Posted June 24, 2021 On 6/23/2021 at 12:31 AM, alpalbents said: @mickeyardell what can I do for my site that is experiencing vertical scrolling in the footer, after restricting the margin between blocks? I want the max height to be the same as the instagram and the footer bar. https://www.moonvalleydesign.co/ Hi. Which element? 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
delmi Posted April 11, 2022 Share Posted April 11, 2022 (edited) Captions and space between image and text. sections To add in customs CSS. It works for me in case of if you want to reduce space between an image (photo) and a new section (text). Just increase or decrease the margin bottom to -15px .sqs-block { margin-left: 0px; margin-right: 0px; margin-top: 0px; margin-bottom: -15px; } and this one for the caption text below the image: .image-caption-wrapper { margin-top: 0 !important; padding-top: 0 !important;} Edited April 11, 2022 by delmi Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment