This is pretty simple. You just need to set the color of top/bottom borders of the ::before
pseudo-element to the background color and change the color of left border to transparent.
Then you could use margins/offsets to position the pseudo-element properly.
body { background-color: gold; }
#flag {
width: 400px; height: 80px; background: #231f20; position: relative;
margin-left: 35px;
color: white;
line-height: 80px;
text-align: center;
}
#flag:before {
content: "";
position: absolute;
top: 0;
left: -35px;
width: 0;
height: 0;
border-top: 40px solid #231f20;
border-bottom: 40px solid #231f20;
border-left: 35px solid transparent;
}
#flag:after {
content: "";
position: absolute;
left: 400px;
bottom: 0;
width: 0;
height: 0;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 45px solid #231f20;
}
This is it!