Jump to content

Custom section dividers - using CSS chevrons

Recommended Posts

Hello SS.

see: https://www.nerv.co.uk

I've added some custom CSS chevrons to the end and beginning of sections as follows:

 

screencapture-nerv-co-uk-2023-03-16-11_10_00.thumb.png.1dd45b57819ed50cc9af8487cb658acd.png

 

This is an example of the code I am using:

section[data-section-id="6411cfe88e268e5653a774b3"] {
  ::before {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    width: 50%;
    height: 100%;
    position: absolute;
    content: "";
    bottom: 1.2em;
    left: 0;
    background: #EAECE7;
    -webkit-transform: skewY(4deg);
    transform: skewY(4deg);
}
   &:after {
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
    width: 50%;
    height: 100%;
    position: absolute;
    content: "";
    bottom: 1.2em;
    right: 0;
    background: #EAECE7;
    -webkit-transform: skewY(-4deg);
    transform: skewY(-4deg);
}
}

It's fine on mobile and when the desktop browser is 'standard' width, but as you can see when the browser is stretched wider, the chevron breaks and the 'sharp' point in the middle is lost.

 

screencapture-nerv-co-uk-2023-03-16-11_10_19.thumb.png.45e3e65fe66ffd94fd35cc205276450a.png

 

Any smart folks out there able to help me fix this?

Many thanks.

Link to comment
  • Replies 3
  • Views 320
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I can not see the problem on your site. Can you mark your issues on your images?

Edited by Beyondspace

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Thanks for coming back on this.

On this one you can see the chevron breaks in the centre:

Screenshot2023-03-16at15_40_32.png.ff73291311dc927428aa5bf43fa39f31.png

 

And on this one you can see where the outside edges of the chevron don't overlap the block below and there is a crack of white instead of a solid background.

 

Screenshot2023-03-16at15_40_48.thumb.png.e06c294e861ceccda7bde3b1a3b59b5b.png

 

 

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.