<div class="cp_card">
コンテンツ
<div class="cp_ribbon02">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 320px;
height: 340px;
background: #ffffff;
overflow: visible;
margin: 2em auto;
padding: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの部分*/
.cp_ribbon02 {
width: 106px;
height: 108px;
overflow: hidden;
position: absolute;
top: -6px;
left: -6px;
}
.cp_ribbon02 .cp_ribbon {
font-size: 1em;
line-height: 1.2em;
position: relative;
top: 26px;
left: -33px;
width: 150px;
padding: 7px 0;
transform: rotate(-45deg);
text-align: center;
letter-spacing: 0.5px;
color: #ffffff;
background-color: #FF9800;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.cp_ribbon02 .cp_ribbon::before,.cp_ribbon02 .cp_ribbon::after {
position: absolute;
bottom: -4px;
content: '';
border-width: 4px 4px 0 4px;
border-style: solid;
border-color: #EF6C00 transparent transparent transparent;
}
.cp_ribbon02 .cp_ribbon:before {
left: 0;
}
.cp_ribbon02 .cp_ribbon:after {
right: 0;
}