<div class="cp_card">
コンテンツ
<div class="cp_ribbon04">
<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_ribbon04 {
width: 104px;
height: 103px;
overflow: hidden;
position: absolute;
bottom: -4px;
left: -4px;
}
.cp_ribbon04 .cp_ribbon {
font-size: 1em;
line-height: 1.2em;
position: relative;
bottom: -50px;
left: -33px;
width: 150px;
padding: 7px 0;
transform: rotate(45deg);
text-align: center;
letter-spacing: 0.5px;
color: #ffffff;
background-color: #9C27B0;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.cp_ribbon04 .cp_ribbon::before,
.cp_ribbon04 .cp_ribbon::after {
position: absolute;
top: -4px;
content: '';
border-width: 4px 4px 0 4px;
border-style: solid;
border-color: transparent transparent transparent #6A1B9A;
}
.cp_ribbon04 .cp_ribbon:before {
left: 0;
}
.cp_ribbon04 .cp_ribbon:after {
right: 4px;
top: -4px;
border-width: 0 4px 4px 4px;
border-color: transparent transparent #6A1B9A transparent;
}