Jump to content

Adding border to image make it offset from the wrapper

Recommended Posts

Hi there!


I'm trying to add a while border to all images in a specific section. I'm using this code for each blockID

#block-0c00759fd0846c881ded {
    border: 8px solid white;
  padding: -8px;


The issue is that it's making the image not fit inside the wrapper anymore, which isn't that big of a deal on desktop but on web it means everything is slightly off. See image below.


So two questions:

1. How do I set the stroke to align to the inside of the image wrapper so the image stays within the box I've made for it.

2. How do I add it to all images in a section without having to call out each blockID individually 

Screenshot 2023-08-24 at 8.40.18 PM.png

Link to comment

Try this method using a pseudo-element:

#block-0c00759fd0846c881ded:after {
  border:8px solid #fff;

Play with the border, top and right values to get the look you want.

Let me know how that works for you.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.