[装飾系]リボン 右下に巻かれたリボン

CSS HTML
 2018.03.05
 2018.03.23

右下に巻かれたリボン

ブロックの右下にペロッと巻かれたリボンデザインです。

browser:  65 11 20 10 
ニャン易度 
images
Ribbon
<div class="cp_card">
コンテンツ
	<div class="cp_ribbon03">
		<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_ribbon03 {
	width: 114px;
	height: 103px;
	overflow: hidden;
	position: absolute;
	bottom: -4px;
	right: -6px;
}
.cp_ribbon03 .cp_ribbon {
	font-size: 1em;
	line-height: 1.2em;
	position: relative;
	bottom: -45px;
right: 0px;
	width: 150px;
	padding: 7px 0;
	-webkit-transform: rotate(-45deg);
	        transform: rotate(-45deg);
	text-align: center;
	letter-spacing: 0.5px;
	color: #ffffff;
	background-color: #009688;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.cp_ribbon03 .cp_ribbon::before,.cp_ribbon03 .cp_ribbon::after {
	position: absolute;
	top: -4px;
	content: '';
	border-width: 4px 4px 0 4px;
	border-style: solid;
	border-color: transparent transparent transparent #00695C;
}
.cp_ribbon03 .cp_ribbon:before {
	left: 0;
}
.cp_ribbon03 .cp_ribbon:after {
	right: 2px;
	top: -4px;
	border-width: 0 4px 4px 4px;
	border-color: transparent #00695C #00695C transparent;
}

copypet.jp

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

More Info

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