Ribbon

<div class="container">
<!-- The content -->
...
<!-- The left side -->
<div class="container__side container__side--left"></div>
<!-- The left triangle displayed below the content -->
<div class="container__triangle container__triangle--left"></div>
<!-- The right triangle displayed below the content -->
<div class="container__triangle container__triangle--right"></div>
<!-- The right side -->
<div class="container__side container__side--right"></div>
</div>
.container {
/* Center the content */
align-items: center;
display: flex;
justify-content: center;
/* Background color */
background-color: #bbb;
/* Size */
height: 32px;
/* Use to position the corners */
position: relative;
}
.container__side {
bottom: -8px;
position: absolute;
/* Displayed under the container */
z-index: -1;
/* Background */
border: 16px solid #ccc;
border-left-color: transparent;
}
.container__side--left {
/* Position */
left: -24px;
}
.container__side--right {
/* Position */
right: -24px;
}
.container__triangle {
position: absolute;
top: 100%;
border: 8px solid transparent;
border-bottom-width: 0;
border-top-color: #aaa;
}
.container__triangle--left {
border-right-width: 0;
left: 0;
}
.container__triangle--right {
border-left-width: 0;
right: 0;
}

See also

Corner ribbon