コピペでできる!CSSとhtmlのみのブログの記事などで注目して欲しい時などにつかう「注目枠」のデザイン

CSS HTML
 2018.01.17
 2018.03.17

ブログの記事などで注目して欲しい時などにつかうチェックポイントの一覧などの「注目枠」サンプルです。
長文になってしまった時などにこれを利用すると、何を読むべきかがわかり見やすくなります。
また、デザインによっては目次などにも使い回しがきくでしょう。

アイコンはfontawesomeを使用しています。

browser:  65 11 20 10 

記事内で注目させたい時のパーツデザイン[4種]

タブをつけた注目枠

ニャン易度
  • ネコ(猫)は、狭義には食肉目ネコ科ネコ属に分類されるヨーロッパヤマネコが家畜化されたイエネコに対する通称である。
  • 人間によくなつくため、イヌ(犬)と並ぶ代表的なペットとして世界中で広く飼われている。
<ul class="cp_point" title="チェックポイント!">
<li>テキスト</li>
<li>テキスト</li>
</ul>
.cp_point {
	position: relative;
	margin: 40px 0 30px;
	padding: 25px 20px 15px 40px;
	border: 3px double #da3c41;
	background-color: #fffafa;
	border-radius: 10px;
}
.cp_point::before {
	position: absolute;
	top: -1.25em;
	left: 1.5em;
	content: attr(title);
	padding: .3em .5em 0 2em;
	font-size: 90%;
	font-weight: bold;
	color: #da3c41;
	height: 27px;
	background-color: #fcfcfc;
	border-radius: 20px;
	border: 2px solid #da3c41;
}
.cp_point::after {
	position: absolute;
	top: -1em;
	left: .5em;
	font-family: FontAwesome;
	content: "\f164 ";
	padding: .3em 0 0 0;
	font-size: 18px;
	color: #fff;
	line-height: 25px;
	text-align: center;
	width: 35px;
	height: 30px;
	background-color: #da3c41;
	border-radius: 20px 0 0 20px;
}
.cp_point li {
	position: relative;
	list-style-type: none;
}
.cp_point li::before {
	position: absolute;
	top: .25em;
	left: -1.5em;
	font-family: FontAwesome;
	content: "\f138 ";
	color: #bbb;
}

シンプルな注目枠

ニャン易度
  • ネコ(猫)は、狭義には食肉目ネコ科ネコ属に分類されるヨーロッパヤマネコが家畜化されたイエネコに対する通称である。
  • 人間によくなつくため、イヌ(犬)と並ぶ代表的なペットとして世界中で広く飼われている。
<ul class="cp_point" title="check!">
<li>テキスト</li>
<li>テキスト</li>
</ul>
.cp_point {
	position: relative;
	margin: 40px 0 30px;
	padding: 25px 20px 15px 40px;
	border: 1px dotted #1b2538;
	background-color: #f8fdff;
	border-radius: 8px;
}
.cp_point::before {
	position: absolute;
	top: -1em;
	left: 1em;
	content: attr(title);
	padding: .4em 1em 0 2.5em;
	font-size: 90%;
	font-weight: bold;
	font-style: italic;
	color: #fff;
	height: 27px;
	background-color: #1b2538;
	border-radius: 4px;
}
.cp_point::after {
	position: absolute;
	top: -1em;
	left: 1.3em;
	font-family: FontAwesome;
	content: "\f046";
	padding: .5em .5em 0 0;
	font-size: 18px;
	color: #fff;
	line-height: 25px;
	text-align: center;
}
.cp_point li {
	position: relative;
	list-style-type: none;
}
.cp_point li::before {
	position: absolute;
	top: .25em;
	left: -1em;
	font-family: FontAwesome;
	content: "\f0da ";
	color: #333;
}

リボン型のラベル付き

ニャン易度
  • ネコ(猫)は、狭義には食肉目ネコ科ネコ属に分類されるヨーロッパヤマネコが家畜化されたイエネコに対する通称である。
  • 人間によくなつくため、イヌ(犬)と並ぶ代表的なペットとして世界中で広く飼われている。
<ul class="cp_point">
<li>テキスト</li>
<li>テキスト</li>
</ul>
.cp_point {
	position: relative;
	margin: 40px 0 30px;
	padding: 55px 20px 15px 40px;
	border: 1px solid #83aaea;
	background-color: #f8fdff;
}
.cp_point::before {
	position: absolute;
	top: .7em;
	left: 0em;
	content: "point!";
	padding: 0em 2em 0em .5em;
	font-size: 90%;
	font-weight: bold;
	line-height: 2;
	color: #fff;
	width: 60px;
	height: 28px;
	background-color: #83aaea;
	border-top: dashed 1px #FFF;
	border-bottom: dashed 1px #FFF;
	box-shadow: 0px 0px 0px 3px #83aaea;
}
.cp_point::after {
	position: absolute;
	content: '';
	z-index: 1;
	top: .49em;
	left: 5.7em;
	width: 0px;
	height: 0px;
	border-width: 17px 8px 17px 0px;
	border-color: transparent #f8fdff transparent transparent;
	border-style: solid;
}
.cp_point li {
	position: relative;
	list-style-type: none;
}
.cp_point li::before {
	position: absolute;
	top: .25em;
	left: -1.3em;
	font-family: FontAwesome;
	content: "\f111 ";
	color: #83aaea;
}

ぺろっと上からラベルをつけたようなデザイン

ニャン易度
  • ネコ(猫)は、狭義には食肉目ネコ科ネコ属に分類されるヨーロッパヤマネコが家畜化されたイエネコに対する通称である。
  • 人間によくなつくため、イヌ(犬)と並ぶ代表的なペットとして世界中で広く飼われている。
<ul class="cp_point" title="point!">
<li>テキスト</li>
<li>テキスト</li>
</ul>
.cp_point {
	position: relative;
	margin: 40px 0 30px;
	padding: 45px 20px 15px 40px;
	background: #fcecec;
	border: 1px solid #da3c3c;
	border-radius: 4px;
}
.cp_point:before,.cp_point:after {
	position: absolute;
	display: block;
}
ul.cp_point:before {
	content: attr(title);
	top: -2px;
	left: 0.5em;
	width: auto;
	height: auto;
	padding: .3em 1em;
	background: #da3c3c;
	text-align: center;
	font-weight: bold;
	font-size: 90%;
	color: #fff;
	box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.2);
	border-bottom: 2px dotted #fcecec;
}
.cp_point li {
	position: relative;
	list-style-type: none;
}
.cp_point li::before {
	position: absolute;
	top: .25em;
	left: -1.3em;
	font-family: FontAwesome;
	content: "\f00c ";
	color: #da3c3c;
}

fontawesome

copypet.jp

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

More Info

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