[パーツ]パンくず グラデーションのようにカラフルなパンくず

CSS HTML
 2018.02.16
 2018.03.22

グラデーションのようにカラフルなパンくず

グラデーションのようにカラフルなパンくずデザインです。

browser:  65 11 20 10 
ニャン易度 
<ul class="cp_breadcrumb">
	<li><a href="">Home</a></li>
	<li><a href="">Category</a></li>
	<li><a href="">Sub Category</a></li>
	<li><a href="">Sub Category</a></li>
	<li><a href="">Contents</a></li>
</ul>
.cp_breadcrumb *, .cp_breadcrumb *:after, .cp_breadcrumb *:before {
	-webkit-box-sizing: border-box;
	        box-sizing: border-box;
}
.cp_breadcrumb {
	overflow: hidden;
	width: 100%;
	margin: 1em auto;
	padding: 0;
	list-style: none;
}
.cp_breadcrumb li {
	display: inline-block;
	padding: 0;
	margin: 0 0 0.5em 0;
}
.cp_breadcrumb a {
	position: relative;
	display: inline-block;
	margin: 0;
	padding: 0.7em 1em 0.7em 2em;
	text-decoration: none;
	color: #ffffff;
	background-color: #e91e63;
}
.cp_breadcrumb li:first-child a {
	padding-left: 1em;
	border-radius: 5px 0 0 5px;
}
.cp_breadcrumb a::after,
.cp_breadcrumb a::before {
	position: absolute;
	top: 50%;
	right: -1.5em;
	margin-top: -1.48em;
	content: '';
	border-top: 1.48em solid transparent;
	border-bottom: 1.48em solid transparent;
	border-left: 1.5em solid;
	}
.cp_breadcrumb a::after {
	z-index: 2;
	border-left-color: #e91e63;
}
.cp_breadcrumb a::before {
	z-index: 1;
	right: -1.8em;
	border-left-color: #ffffff;
}
.cp_breadcrumb li:nth-child(2) a       { background:        #EC407A; }
.cp_breadcrumb li:nth-child(2) a:after { border-left-color: #EC407A; }
.cp_breadcrumb li:nth-child(3) a       { background:        #F06292; }
.cp_breadcrumb li:nth-child(3) a:after { border-left-color: #F06292; }
.cp_breadcrumb li:nth-child(4) a       { background:        #F48FB1; }
.cp_breadcrumb li:nth-child(4) a:after { border-left-color: #F48FB1; }
.cp_breadcrumb li:nth-child(5) a       { background:        #F8BBD0; }
.cp_breadcrumb li:nth-child(5) a:after { border-left-color: #F8BBD0; }

.cp_breadcrumb li:last-child a {
	cursor: default;
	pointer-events: none;
	color: black;
	background:        #f7d7e2;
	border-radius: 0 5px 5px 0;
}
.cp_breadcrumb li:last-child a:hover {
	background: none;
}
.cp_breadcrumb li:last-child a::before,
.cp_breadcrumb li:last-child a::after {
	content: normal;
}

copypet.jp

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

More Info

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