Here is a codepen of what I did: https://codepen.io/dickeddocks/pen/opWBwQ
and this is what I am trying to achieve: a rough picture made in MS-Paint
so I am trying to make box 2, a div overlap box 1 which is also a div and I want to make the yellow border cover the shape and not the container box. I did some research on stackoverflow and an answer to adding a border to a clip path shape was to add the the same clip path to the container. But I am a little confused as the div itself is the container so why is the border not wrapping it.
html:
<div class="box-1">
BOX 1
</div>
<div class="box-2">
BOX 2
</div>
css:
* {
padding: 0;
margin: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
background-color: aqua;
}
.box-1 {
padding: 25vh;
background-color: aqua;
}
.box-2 {
z-index: 200;
-webkit-clip-path: polygon(50% -10%, 100% 11%, 100% 100%, 0 100%, 0 11%);
clip-path: polygon(50% -10%, 100% 11%, 100% 100%, 0 100%, 0 11%);
padding: 25vh;
background-color: aquamarine;
border-top: 10px solid yellow;
}