What I am wondering is how I can have the pattern in the top div appear inside the zig zag. If I apply it to the zig zag, I don’t think it will line up and I am not sure how to add the zig zag part of the top div so it is one element with a background.
In the JsFiddle it seems the image used as background and the background jig-saw aren’t the same dimensions.
Then to make the after-background line up ((with the åarent background), the parent background needs to start at bottom with some adjustment. background-position: left 0 bottom -??px
Also, if using this strategy,the after parent might need a negative z.index to show underneath the parent background-
Another strategy could be to create the border at a the parent or an after element.
One option would be to add a zig-zag class to the container’s parent and give the pseudo element to that class.
Then what I think you tripped on was the angle value. Add 180 to the 45 to flip the gradient and get the transparent on top and then use the dark background color to the bottom side.
A stand alone example:
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">
<title>Title</title>
<style>
.store-mart-lite-top-header-wrap {
padding: 10px;
background: url("https://i.ibb.co/W0JR0Rf/cross-pattern.gif") repeat #ebca99;
background-size: 18px; /* matching the gradient */
background-position: left -2px bottom 0; /* to fit the pseudo bg */
}
.zig-zag::after {
display: block;
margin: 0 -10px -10px; /* soak up padding */
width: calc(100% + 20px);
height: 28px; /* 18px + padding */
background-image: linear-gradient(-225deg, transparent 16px, #a01028 0), linear-gradient(225deg, transparent 16px, #a01028 0);
background-repeat: repeat-x;
background-position: left -9px bottom 0; /* 9px to adjust the flip */
background-size: 18px 28px; /* height matches element */
content: " ";
}
</style>
</head><body>
<div class="store-mart-lite-top-header-wrap zig-zag">
<div class="container ">
Pattern now going into the zig zags
</div>
</div>
</body></html>
I know his is solved with Eriks help but just wanted to mention that you could have used multiple backgrounds on the one element to achieve the effect without extra elements.
e.g.
The cross hatch effect could also be a linear gradient instead of an image if you wanted to spend some time messing around with it