<div class="cp_card">
コンテンツ
<div class="cp_ribbon10_2">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 300px;
height: 300px;
background: #ffffff;
margin: auto;
padding: 35px 5px 0;
border: 2px solid #9575CD;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの位置*/
.cp_ribbon10_2 {
position: absolute;
top: -6px;
left: -6px;
}
/*リボンの設定*/
.cp_ribbon10_2 .cp_ribbon {
padding: 5px 30px 5px 10px;
color: #ffffff;
background-color: #9575CD;
clip-path: polygon(0 0, 100% 0%, 80% 100%, 0% 100%);
}
/*リボンの影*/
.cp_ribbon10_2::before {
position: absolute;
content: '';
top: 100%;
left: 0;
width: 6px;
height: 6px;
background-color: #5E35B1;
clip-path: polygon(0 0, 100% 100%, 100% 0);
}