コピペでできる!cssとhtmlだけのブロックの一部につけるリボンデザイン8種

CSS HTML
 2018.03.05
 2018.03.17

ECサイトなどでよくつかうセールやポイントとしてブロック(商品や画像など)につけるリボン。
こちらではステッチ付きやブロック上部の全体をおおう大きなリボンタイプなどをご用意。

browser:  65 11 20 10 

ブロックの一部につけるリボンデザイン[8種]

右上に巻かれたステッチ入りのリボン

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon05">
		<div class="cp_ribbon">Ribbon</div>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	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 {
	font-size: 1em;
	line-height: 1.2em;
	position: relative;
	top: 26px;
	left: -4px;
	width: 150px;
	padding: 7px 0;
	-webkit-transform: rotate(45deg);
	        transform: rotate(45deg);
	text-align: center;
	letter-spacing: 0.5px;
	color: #333333;
	color: #ffffff;
	border: 1px dashed #ffffff;
	box-shadow: 0px 0px 0px 3px #F48FB1;
	background-color: #F48FB1;
}
.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;
}

右上から垂らすリボン

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon06">
		<span>Ribbon</span>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	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;
	width: 0;
	height: 0;
	content: '';
	border-top: 10px solid #4DD0E1;
	border-right: 53px solid transparent;
	border-left: 53px solid transparent;
}
.cp_ribbon06 span {
	font-size: 1em;
	line-height: 1;
	position: relative;
	display: block;
	width: 90px;
	padding: 12px 8px 10px;
	text-align: center;
	color: #ffffff;
	border-top-right-radius: 8px;
	background: #4DD0E1;
}
.cp_ribbon06 span:before, .cp_ribbon06 span:after {
	position: absolute;
	content: '';
}
.cp_ribbon06 span:before {
	top: 0;
	left: -6px;
	width: 6px;
	height: 6px;
	background: #4DD0E1;
}
.cp_ribbon06 span:after {
	top: 0;
	left: -8px;
	width: 8px;
	height: 6px;
	border-radius: 8px 8px 0 0;
	background: #00ACC1;
}

左上から垂らすリボン(カットがV字)

ニャン易度
images
R
i
b
b
o
n
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon07">
		<span>R<br />i<br />b<br />b<br />o<br />n</span>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.cp_ribbon07 {
	position: absolute;
	top: -6px;
	left: 25px;
	width: 40px;
	padding: 10px 0;
	text-align: center;
	border-top-left-radius: 3px;
	color: #ffffff;
	background: #FFC107;
}
.cp_ribbon07:before {
	top: 0.1px;
	right: -5.5px;
	width: 0;
	height: 0;
	border-right: 6px solid transparent;
	border-bottom: 6px solid #FF8F00;
}
.cp_ribbon07:before, .cp_ribbon07:after {
	position: absolute;
	content: '';
}
.cp_ribbon07:after {
	bottom: -19.5px;
	left: 0;
	width: 0;
	height: 0;
	border-right: 20px solid #FFC107;
	border-bottom: 20px solid transparent;
	border-left: 20px solid #FFC107;
}

左側から横に出たリボン

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon08">
		<span>Ribbon</span>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.cp_ribbon08 {
	line-height: 50px;
	position: absolute;
	top: 20px;
	left: -8px;
	width: 150px;
	height: 50px;
	padding-left: 15px;
	color: #ffffff;
	background: #4CAF50;
}
.cp_ribbon08:before, .cp_ribbon08:after {
	position: absolute;
	content: '';
}
.cp_ribbon08:before {
	top: -8.5px;
	left: 0.1px;
	width: 0;
	height: 0;
	border-bottom: 9px solid #2E7D32;
	border-left: 9px solid transparent;
}
.cp_ribbon08:after {
	right: -14.5px;
	width: 0;
	height: 0;
	border-top: 25px solid transparent;
	border-bottom: 25px solid transparent;
	border-left: 15px solid #4CAF50;
}

右側から横に出たリボン

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon09">
		<span>Ribbon</span>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.cp_ribbon09 {
	line-height: 3em;
	position: absolute;
	top: 15px;
	right: -10px;
	width: 150px;
	height: 50px;
	padding-left: 0.5em;
	color: #ffffff;
	background: #21759a;
}
.cp_ribbon09:before {
	position: absolute;
	top: -10px;
	right: 0;
	content: '';
	border-top: 5px solid transparent;
	border-right: 5px solid transparent;
	border-bottom: 5px solid #14455b;
	border-left: 5px solid #14455b;
}
.cp_ribbon09:after {
	position: absolute;
	top: 0;
	left: -25px;
	content: '';
	border-top: 25px solid #21759a;
	border-right: 0 solid #21759a;
	border-bottom: 25px solid #21759a;
	border-left: 25px solid transparent;
}

左上にかかったリボン

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon10">
		<span>Ribbon</span>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	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 10px;
	padding-right: 40px;
	letter-spacing: 0.1px;
	color: #ffffff;
	background: linear-gradient(-45deg,transparent,transparent 25%,#9575CD 0%,#9575CD);
}
.cp_ribbon10::before {
	position: absolute;
	z-index: 10;
	top: 100%;
	left: 0;
	content: ' ';
	border: 3px solid transparent;
	border-top: 3px solid #5E35B1;
	border-right: 3px solid #5E35B1;
}

上全体にかかったリボン

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon11">
		<span>Ribbon</span>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.cp_ribbon11 {
	line-height: 50px;
	position: absolute;
	top: 15px;
	display: block;
	width: calc(100% + 20px);
	height: 50px;
	margin-right: -10px;
	margin-left: -18px;
	text-align: center;
	color: #ffffff;
	background: #2196F3;
}
.cp_ribbon11:before, .cp_ribbon11:after {
	position: absolute;
	content: '';
}
.cp_ribbon11:before {
	bottom: -10px;
	left: 0;
	width: 0;
	height: 0;
	border-top: 10px solid #1565C0;
	border-left: 10px solid transparent;
}
.cp_ribbon11:after {
	right: 0;
	bottom: -10px;
	width: 0;
	height: 0;
	border-top: 10px solid #1565C0;
	border-right: 10px solid transparent;
}

上全体にかかったリボン(カットがV字)

ニャン易度
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon12">
		<div class="cp_ribbon">Ribbon</div>
	</div>
</div>
.cp_card {
	width: 320px;
	height: 340px;
	position: relative;
	background: #ffffff;
	overflow: visible;
	margin: 2em auto;
	padding: 0.5em;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.cp_ribbon12 {
	position: absolute;
	z-index: 200;
	top: 15px;
	width: calc(100% + 20px);
	height: 50px;
	margin-right: -18px;
	margin-bottom: 80px;
	margin-left: -18px;
}
.cp_ribbon12:before, .cp_ribbon12:after {
	position: absolute;
	top: 20px;
	bottom: -10px;
	width: 0;
	height: 0;
	content: '';
	border-width: 20px 20px;
}
.cp_ribbon12:before {
	left: -30px;
	border-style: solid;
	border-color: #F06292 #F06292 #F06292 transparent;
}
.cp_ribbon12:after {
	right: -30px;
	border-style: solid;
	border-color: #F06292 transparent #F06292 #F06292;
}
.cp_ribbon12 .cp_ribbon {
	line-height: 3em;
	position: relative;
	z-index: 100;
	height: inherit;
	margin-bottom: 0;
	text-align: center;
	color: #ffffff;
	background: #F48FB1;
}
.cp_ribbon12 .cp_ribbon:before, .cp_ribbon12 .cp_ribbon:after {
	position: absolute;
	bottom: -10px;
	width: 0;
	height: 0;
	content: '';
	border-top: 10px solid #C2185B;
}
.cp_ribbon12 .cp_ribbon:before {
	left: 0;
	border-left: 10px solid transparent;
}
.cp_ribbon12 .cp_ribbon:after {
	right: 0;
	border-right: 10px solid transparent;
}

シンプルな四隅のリボンが欲しい!

copypet.jp

コピペでできる!cssとhtmlだけのコーナーにつけるシンプルなリボンデザイン4種 | copypet.jp|パーツで探す、web制作に使えるコピペサイト。

ECサイトなどでよくつかうセールやポイントとしてブロック(商品や画像など)の四隅につけるリボン。 こちらではそれぞれ右上下・左上下の四隅につけるシンプルなデザインをご紹介。…

copypet.jp

記事を見る

copypet.jp

CSS3などで新たに追加された要素・装飾方法など、日々コードを書いていないと忘れてしまったり、ささっとプロトタイプを作る時などちょっとしたことに時間をかけている暇はない。そんな時に「あ〜、あれストックしときゃよかったなぁ」って困った自分用のストックブログです。カスタマイズなどがしやすいよう、昨今のweb制作に取り入れられる一般的なコードを中心に掲載しています。

More Info

こんな記事はいかがですか?