<div class="cp_card">
コンテンツ
<div class="cp_ribbon07">
<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_ribbon07 {
position: absolute;
top: -6px;
left: 15px;
text-align: center;
writing-mode:vertical-rl;
text-orientation: upright;
border-top-left-radius: 3px;
color: #ffffff;
background: #FFC107;
}
/*リボン内のテキスト*/
.cp_ribbon07 .cp_ribbon {
position: relative;
display: flex;
align-items: center;
width: 40px;
padding: 10px 0px;
}
/*擬似要素の共通設定*/
.cp_ribbon07:before,
.cp_ribbon07:after {
position: absolute;
content: '';
}
.cp_ribbon07:before {/*リボンの影部分*/
top: 0.1px;
right: -5.5px;
border-right: 6px solid transparent;
border-bottom: 6px solid #FF8F00;
}
.cp_ribbon07:after {/*リボン下のカット部分*/
bottom: -19.5px;
left: 0;
border-right: 20px solid #FFC107;
border-bottom: 20px solid transparent;
border-left: 20px solid #FFC107;
}