Jump to content

how to create an offset border from background for text box

Recommended Posts

  • Replies 2
  • Views 714
  • Created
  • Last Reply

Hello!

Without knowing all of the specifics of how you want to target and customize the effect using your unique Squarespace blocks/objects you may need to adjust some of the following code to fit your needs:

 #block-YOUR_BLOCK_ID {
  .sqs-block-content {
  color: #fff;
  width: 100;
  margin: 0 auto;
  padding: 3vw;
  background: slateblue;
  position: relative;
  }
    .sqs-block-content::before {
      content: "";
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  border: 2px solid white;
  top: -12px;
  left: -12px;
    }
  }

If you do not use a Block ID, all elements on the page will adopt the effect and it'll look rather... interesting.

Anyways --

Hope this helps, Happy Web-Building!

Link to comment
On 4/27/2021 at 2:52 AM, baileyeidahl said:

Is there a way to create this effect for a text box with CSS? I figured in out for images but cant figure it out for a text box. Thanks! 

Screen Shot 2021-04-26 at 2.50.25 PM.png

Hi. Can you share link to your site? 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.