<div class="cp_card">
コンテンツ
<div class="cp_ribbon12_2">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 300px;
height: 300px;
background: #ffffff;
margin: auto;
padding: 70px 5px 0;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの設定*/
.cp_ribbon12_2 {
position: absolute;
top: 15px;
left: -10px;
width: calc(100% + 20px);
}
/*リボンの帯部分*/
.cp_ribbon12_2 .cp_ribbon {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 40px;
color: #ffffff;
background: #F48FB1;
z-index: 0;
}
/*カットされたリボンの共通設定*/
.cp_ribbon12_2:before,
.cp_ribbon12_2:after {
position: absolute;
bottom: -10px;
content: '';
width: 40px;
height: 40px;
background-color: #F06292;
clip-path: polygon(0 0, 100% 0%, 100% 100%, 0 100%, 35% 50%);
z-index: -1;
}
.cp_ribbon12_2:before {
left: -30px;
}
.cp_ribbon12_2:after {
right: -30px;
transform: scale(-1, 1);/*左右反転*/
}
/*リボンの影の共通設定*/
.cp_ribbon12_2 .cp_ribbon:before,
.cp_ribbon12_2 .cp_ribbon:after {
position: absolute;
top: 100%;
content: '';
width: 10px;
height: 10px;
background-color: #C2185B;
clip-path: polygon(0 0, 100% 100%, 100% 0);
}
.cp_ribbon12_2 .cp_ribbon:before {
left: 0;
}
.cp_ribbon12_2 .cp_ribbon:after {
right: 0;
transform: scale(-1, 1);/*左右反転*/
}