Jump to content

Set image full bleed outside of site padding

Recommended Posts

Site URL: https://www.craftedfestival.com.au/

Hi guys, 

I've been doing some serious CSS hacking trying to get a wave graphic to sit over my banner images on the Brine Template.

I've managed to add the image to every page, however the site has 30px of padding site wide. To get the image to be full width, I've added a -30px margin to the left but then the banner stops short on the right as the width isn't long enough. To overcome this, I've tried making the wide 100% + 30px but for some reason this extends the graphic outside of the website container and makes a horizontal scroll bar for about 200px! So now I've got the width set to 103% which works on some screen sizes, but either goes past site boundary on extra large widths, and falls short on mobile. 

Any ideas on how to get the wave graphic to just fit perfectly at 100% of the page but not within the site padding boundary??

 

/*Add wave to banner images*/

#block-yui_3_17_2_1_1620107629754_2747{

  overflow: visible;

  &:before {

    content: '';

    width: calc (100% + 30px);

    height: 100px;

    background-image: url(https://static1.squarespace.com/static/58a18e6da5790a7c3fcaaf73/t/6090a1cb6f648c6378f7640d/1620091339242/Image-wave.png);

    position: absolute;

   margin-top: -100px;

    margin-left: -30px;

  }

}

Link to comment
  • Replies 0
  • Views 298
  • Created
  • Last Reply

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.