[パーツ]タグ リボンがひょっこり出てくるタグデザイン

CSS HTML
 2018.03.23

リボンがひょっこり出てくるタグデザイン

ブログなどの記事下につけるリボンがひょっこり出てくるタグデザインです。

browser:  65 11 20 10 
ニャン易度 
<ul class="cp_tag05">
<li><a href="#"><span class="text">Dog</span><span class="count">15</span></a></li>
<li><a href="#"><span class="text">Cat</span><span class="count">15</span></a></li>
<li><a href="#"><span class="text">Rabbit</span><span class="count">15</span></a></li>
</ul>
.cp_tag05 {
	margin: 0;
	padding: 0;
	position: absolute;
	top: 50%;
	left: 50%;
	-webkit-transform: translate(-50%,-50%);
					transform: translate(-50%,-50%);
}
.cp_tag05 li {
	position: relative;
	display: inline-block;
	margin: 0 10px 8px 10px;
	list-style: none;
}
.cp_tag05 a {
	position: relative;
	display: inline-block;
	height: auto;
	margin: 0.5em 0 0.5em 20px;
	-webkit-transition: margin 500ms ease-in-out;
	        transition: margin 500ms ease-in-out;
	text-align: center;
	text-decoration: none;
	color: #666666;
}
.cp_tag05 .text {
	position: relative;
	z-index: 4;
	height: 26px;
	padding: 5px 15px;
	border-width: 1px 3px 1px 1px;
	border-style: solid;
	border-color: #dadada #E91E63 #d2d2d2 #c5c5c5;
	border-radius: 3px 0 0 3px;
	background: #ffffff;
}
.cp_tag05 a::after {
	position: absolute;
	top: -1px;
	right: 4px;
	z-index: 99;
	display: inline-block;
	height: 114%;
	content: '';
	border-right: 1px solid #E91E63;
}
.cp_tag05 .count {
	font-size: 0.8em;
	line-height: 26px;
	position: absolute;
	z-index: 3;
	top: -1px;
	right: -9px;
	display: block;
	width: 45px;
	height: 26px;
	padding-right: 5px;
	-webkit-transition: right 500ms ease-in-out;
	        transition: right 500ms ease-in-out;
	color: #ffffff;
	background: #f06292;
}
.cp_tag05 .count::before, .cp_tag05 .count::after {
	position: absolute;
	z-index: 1;
	top: 0;
	right: 0;
	display: block;
	width: 0;
	height: 0;
	content: '';
}
.cp_tag05 .count::after {
	z-index: 2;
	right: -1px;
	display: inline-block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 13px 8px 13px 0;
	border-color: transparent #fafcfc transparent transparent;/*背景色*/
}
.cp_tag05 a:hover {
	margin-right: 30px;
}
.cp_tag05 a:hover .count {
	right: -40px;
}

copypet.jp

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

More Info

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