[パーツ]パンくず シンプルなパンくずデザイン

CSS HTML
 2018.02.16
 2018.03.22

シンプルなパンくずデザイン

シンプルなパンくずデザインです。

browser:  65 11 20 10 
ニャン易度 
<div class="cp_breadcrumb">
	<ul class="breadcrumbs">
	<li><a href="#">Home</a></li>
	<li><a href="#">Category</a></li>
	<li><a href="#">Sub Category</a></li>
	<li>Contents</li>
	</ul>
</div>
.cp_breadcrumb *, .cp_breadcrumb *:after, .cp_breadcrumb *:before {
	-webkit-box-sizing: border-box;
	        box-sizing: border-box;
}
.cp_breadcrumb {
	margin: 1em auto;
	padding: 1em 2em;
	background-color: #3949AB;
	color: #fff;
	border-radius: 0.5em;
}
.cp_breadcrumb a {
	text-decoration: none;
	color: #7986CB;
}
.cp_breadcrumb .breadcrumbs {
	padding-left: 0;
	margin-top: 0;
	margin-bottom: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
}
.cp_breadcrumb li {
	display: inline-block;
	position: relative;
	padding-right: calc(16px + 8px);
	margin-right: 8px;
	color: #7986CB;
}
.cp_breadcrumb li::before {
	content: '›';
	width: 1em;
	height: 1em;
	line-height: 1;
	text-align: center;
	font-size: 1em;
	color: inherit;
	position: absolute;
	top: 50%;
	right: 0;
	-webkit-transform: translateY(-50%);
	        transform: translateY(-50%);
}
.cp_breadcrumb li:last-child {
	margin-right: 0;
	padding-right: 0;
	color: #ffffff;
}
.cp_breadcrumb li:last-child::before {
	content: normal;
}

copypet.jp

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

More Info

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