<div class="cp_card">
コンテンツ
<div class="cp_ribbon11_2">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 300px;
height: 300px;
background: #ffffff;
margin: auto;
padding: 60px 5px 0;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの設定*/
.cp_ribbon11_2 {
line-height: 50px;
position: absolute;
top: 15px;
display: flex;
justify-content: center;
align-items: center;
width: calc(100% + 10px);
height: 40px;
margin-right: -10px;
margin-left: -10px;
text-align: center;
color: #ffffff;
background: #2196F3;
}
/*リボンの影の共通設定*/
.cp_ribbon11_2:before,
.cp_ribbon11_2:after {
position: absolute;
top: 100%;
content: '';
width: 6px;
height: 6px;
background-color: #1565C0;
clip-path: polygon(0 0, 100% 100%, 100% 0);
}
.cp_ribbon11_2:before {
left: 0;
}
.cp_ribbon11_2:after {
right: 0;
transform: scale(-1, 1);/*左右反転*/
}