<div class="cp_card">
コンテンツ
<div class="cp_ribbon05">
<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_ribbon05 {
position: absolute;
top: -6px;
right: -6px;
overflow: hidden;
width: 108px;
height: 108px;
}
.cp_ribbon05 .cp_ribbon {
position: relative;
top: 26px;
left: -4px;
font-size: 1em;
line-height: 1.2em;
width: 150px;
padding: 7px 0;
text-align: center;
letter-spacing: 0.5px;
color: #ffffff;
border: 1px dashed #ffffff;
box-shadow: 0px 0px 0px 3px #F48FB1;
background-color: #F48FB1;
transform: rotate(45deg);
}
/*リボンの影の部分*/
.cp_ribbon05 .cp_ribbon:before,
.cp_ribbon05 .cp_ribbon:after {
position: absolute;
bottom: -8px;
content: '';
border-width: 4px 4px 0 4px;
border-style: solid;
border-color: #EC407A transparent transparent transparent;
}
.cp_ribbon05 .cp_ribbon:before {
left: -4px;
}
.cp_ribbon05 .cp_ribbon:after {
right: 3px;
}
<div class="cp_card">
コンテンツ
<div class="cp_ribbon06">
<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_ribbon06 {
position: absolute;
top: -6.1px;
right: 10px;
}
/*リボンの三角形部分*/
.cp_ribbon06:after {
position: absolute;
content: '';
border-top: 10px solid #4DD0E1;
border-right: 53px solid transparent;
border-left: 53px solid transparent;
}
/*リボン全体の背景*/
.cp_ribbon06 .cp_ribbon {
position: relative;
display: block;
width: 90px;
font-size: 1em;
line-height: 1;
padding: 12px 8px 10px;
text-align: center;
color: #ffffff;
border-top-right-radius: 8px;
background: #4DD0E1;
}
/*リボンの影の部分*/
.cp_ribbon06 .cp_ribbon:before,
.cp_ribbon06 .cp_ribbon:after {
position: absolute;
top: 0;
content: '';
}
.cp_ribbon06 .cp_ribbon:before {
left: -6px;
width: 6px;
height: 6px;
background: #4DD0E1;
}
.cp_ribbon06 .cp_ribbon:after {
left: -8px;
width: 8px;
height: 6px;
border-radius: 8px 8px 0 0;
background: #00ACC1;
}
<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;
}
<div class="cp_card">
コンテンツ
<div class="cp_ribbon08">
<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_ribbon08 {
position: absolute;
top: 20px;
left: -8px;
}
/*リボン内のテキスト*/
.cp_ribbon08 .cp_ribbon {
position: relative;
display: flex;
align-items: center;
width: 100%;
height: 40px;
padding: 0 0 0 10px;
color: #ffffff;
background: #4CAF50;
}
/*擬似要素の共通設定*/
.cp_ribbon08:before,
.cp_ribbon08:after {
position: absolute;
content: '';
}
.cp_ribbon08:before {/*リボンの影部分*/
top: -8.5px;
left: 0.1px;
border-bottom: 9px solid #2E7D32;
border-left: 9px solid transparent;
}
/**/
.cp_ribbon08:after {/*リボン下のカット部分*/
top: 0;
right: -20px;
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 10px solid #4CAF50;
}
<div class="cp_card">
コンテンツ
<div class="cp_ribbon09">
<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_ribbon09 {
position: absolute;
top: 15px;
right: -6px;
display: flex;
align-items: center;
height: 40px;
padding: 0 10px;
color: #ffffff;
background: #21759a;
}
.cp_ribbon09:before,
.cp_ribbon09:after {
position: absolute;
content: '';
}
.cp_ribbon09:before {
top: -6px;
right: 0;
border-top: 3px solid transparent;
border-right: 3px solid transparent;
border-bottom: 3px solid #14455b;
border-left: 3px solid #14455b;
}
.cp_ribbon09:after {
top: 0;
left: -20px;
border-top: 20px solid #21759a;
border-bottom: 20px solid #21759a;
border-left: 20px solid transparent;
}
<div class="cp_card">
コンテンツ
<div class="cp_ribbon10">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 300px;
height: 300px;
background: #ffffff;
margin: auto;
padding: 35px 5px 0;
border: 2px solid #9575CD;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの設定*/
.cp_ribbon10 {
position: absolute;
top: -6px;
left: -6px;
padding: 5px 40px 5px 10px;
color: #ffffff;
background: linear-gradient(-45deg,transparent,transparent 25%,#9575CD 0%,#9575CD);
}
/*リボンの影*/
.cp_ribbon10::before {
position: absolute;
content: '';
top: 100%;
left: 0;
border: 3px solid transparent;
border-top: 3px solid #5E35B1;
border-right: 3px solid #5E35B1;
}
<div class="cp_card">
コンテンツ
<div class="cp_ribbon11">
<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 {
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:before,
.cp_ribbon11:after {
position: absolute;
top: 100%;
content: '';
border-top: 5px solid #1565C0;
border-left: 5px solid transparent;
}
.cp_ribbon11:before {
left: 0;
}
.cp_ribbon11:after {
right: 0;
transform: scale(-1, 1);/*左右反転*/
}
<div class="cp_card">
コンテンツ
<div class="cp_ribbon12">
<div class="cp_ribbon">Ribbon</div>
</div>
</div>
.cp_card {
position: relative;/*リボンをかけたいコンテンツボックスにセット*/
width: 300px;
height: 300px;
background: #ffffff;
margin: auto;
padding: 70px 5px 0;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
/*リボンの設定*/
.cp_ribbon12 {
position: absolute;
top: 15px;
left: -10px;
width: calc(100% + 20px);
}
/*リボンの帯部分*/
.cp_ribbon12 .cp_ribbon {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 40px;
color: #ffffff;
background: #F48FB1;
z-index: 0;
}
/*カットされたリボンの共通設定*/
.cp_ribbon12:before,
.cp_ribbon12:after {
position: absolute;
bottom: -10px;
content: '';
width: 0;
height: 0;
border-width: 20px 20px;
border-style: solid;
border-color: #F06292 #F06292 #F06292 transparent;
z-index: -1;
}
.cp_ribbon12:before {
left: -30px;
}
.cp_ribbon12:after {
right: -30px;
transform: scale(-1, 1);/*左右反転*/
}
/*リボンの影の共通設定*/
.cp_ribbon12 .cp_ribbon:before,
.cp_ribbon12 .cp_ribbon:after {
position: absolute;
bottom: -10px;
content: '';
width: 0;
height: 0;
border-top: 10px solid #C2185B;
border-left: 10px solid transparent;
}
.cp_ribbon12 .cp_ribbon:before {
left: 0;
}
.cp_ribbon12 .cp_ribbon:after {
right: 0;
transform: scale(-1, 1);/*左右反転*/
}
コピペでできる!cssとhtmlだけのコーナーにつけるシンプルなリボンデザイン4種 | copypet.jp|パーツで探す、web制作に使えるコピペサイト。
ECサイトなどでよくつかうセールやポイントとしてブロック(商品や画像など)の四隅につけるリボン。 こちらではそれぞれ右上下・左上下の四隅につけるシンプルなデザインをご紹介。…