<div class="cp_card">
コンテンツ
<div class="cp_ribbon02_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_ribbon02_2 .cp_ribbon {
position: absolute;
top: 25px;
left: -40px;
width: 160px;
height: 30px;
background-color: #FF9800;
color: #ffffff;
text-align: center;
line-height: 1.8;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
transform: rotate(-45deg);
}
/*リボンの影の部分*/
.cp_ribbon02_2::before,
.cp_ribbon02_2::after {
position: absolute;
content: '';
width: 6px;
height: 6px;
background-color: #EF6C00;
clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.cp_ribbon02_2:before {
top: -6px;
left: 101px;
}
.cp_ribbon02_2:after {
top: 101px;
left: -6px;
}