<div class="cp_card">
コンテンツ
<div class="cp_ribbon09_2">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 300px;
height: 300px;
background: #ffffff;
margin: auto;
padding: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの位置*/
.cp_ribbon09_2 {
position: absolute;
top: 15px;
right: -6px;
}
.cp_ribbon09_2 .cp_ribbon {
display: flex;
align-items: center;
height: 40px;
padding: 0 10px 0 20px;
color: #ffffff;
background: #21759a;
clip-path: polygon(0 0, 100% 0%, 100% 100%, 0 100%, 15% 50%);
}
/*リボンの影部分*/
.cp_ribbon09_2:before {
position: absolute;
content: '';
top: -6px;
right: 0;
width: 6px;
height: 6px;
background: #14455b;
clip-path: polygon(0 0, 0% 100%, 100% 100%);
}