Use several pseudo-elements and create triangles with their borders, then position them absolutely to sit where you want.
Additional Information About Pseudo Elements
Example
div{
background:#999;
height:300px;
position:relative;
width:100px;
}
div::before,div::after{
content:"";
left:100px;
position:absolute;
}
div::before{
border-bottom:20px solid #333;
border-right:20px solid transparent;
top:0;
}
div::after{
border-top:20px solid #333;
border-right:20px solid transparent;
bottom:0;
}
<div></div>
Run codeHide result source
share