Jump to content

How can I remove the padding around images?

Recommended Posts

How do I remove the padding around images? I inserted two little social media icons and they are miles apart because of the image padding. I added this to the CSS for the page but it didn’t change anything, http://organizegr.com/contact/


.sqs-block.image-block {
 padding-top: 0px;
 padding-bottom: 0px;
 padding-left: 0px;
 padding-right: 0px;
}

In the Config Editor all i see is the code i’ve added, none of the existing code, which strikes me as weird.

Similarly, on the main page, I’d like to have the bottom image flood to the side. But when i change the page padding the text and rule lines also flood to the sides. Can I change it for just the image? Or add padding into the text block manually? http://organizegr.com

Link to comment
  • Replies 16
  • Views 36.3k
  • Created
  • Last Reply

To override some core CSS, you may need to add !important to certain elements. The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important property will always be applied no matter where that rule appears in the CSS document,that is — considering it’s the correct element

Caution:
If you’re wanting to adjust .sqs-block.image-block in your custom CSS, you’re going to effect everything on the site using the same style, which in this case would be any image block you insert.

… but if you want to play, try this:

.sqs-block.image-block { padding: 0 !important }

If that doesn’t work, it could be because they are linked elements, so try:

.sqs-block.image-block a { padding: 0 !important }

Maybe an easier thing to do on the site — to add social network icons would be to use the built-in social blocks, which you can configure here: Using the Social Links Block

Also see: Connecting Social Accounts

Link to comment
  • 11 months later...
  • 3 months later...
  • 1 year later...
  • 3 months later...
  • 6 months later...
  • 7 months later...
Guest iamme123

Honestly, this is the solution I like best for my site, but I have Image Blocks and Text Blocks offset from one another:


 .sqs-block.image-block {
margin-top: -8px;
margin-bottom: -8px;
  padding: 0;
}

This allows my Image Block corners to touch when they're in different rows, without overlapping any of the content (see screenshot).

padding-screenshot.png.70576be0f441052685907ca2927058da.png

Link to comment
  • 3 years later...

I've tried many different codes and I can't seem to get the padding off from the top and bottom. Here's one of the codes and a screenshot (they're all essentially the same it seems). I'd like to achieve a photo wall with no padding between images.

 

 .sqs-block.image-block {
margin-top: 0px !important;
margin-bottom: 0px !important;
  padding: 0;
}

1409528357_ScreenShot2020-09-21at12_26_16PM.thumb.png.bc8dd903ae423c907400138d67b21166.png

 

Link to comment
On 9/22/2020 at 2:26 AM, DylanSG said:

I've tried many different codes and I can't seem to get the padding off from the top and bottom. Here's one of the codes and a screenshot (they're all essentially the same it seems). I'd like to achieve a photo wall with no padding between images.

 

 .sqs-block.image-block {
margin-top: 0px !important;
margin-bottom: 0px !important;
  padding: 0;

Can you share link to page in screenshot? 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.