[パーツ]Q&A 左右に分けたシンプルなQ&Aデザイン

CSS HTML
 2018.02.12
 2018.03.20

シンプルなQ&Aデザイン

左右に分けたシンプルなQ&Aデザインです。

browser:  65 11 20 10 
ニャン易度 

質問テキスト 質問テキスト 質問テキスト question?

答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text.

質問テキスト 質問テキスト 質問テキスト question?

答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text. 答えテキスト answer text.

<div class="cp_qa">
<div class="cp_qanda">
	<p class="quest">質問テキスト</p>
	<p class="answer">答えテキスト</p>
</div>
<div class="cp_qanda">
	<p class="quest">質問テキスト</p>
	<p class="answer">答えテキスト</p>
</div>
</div>
.cp_qa *, .cp_qa *:after, .cp_qa *:before {
	-webkit-box-sizing: border-box;
	        box-sizing: border-box;
}
.cp_qa .cp_qanda {
	line-height: 1.5;
	position: relative;
	margin: 0 0 2em 15em;
	padding: 0 0 0 1em;
	border-left: 1px solid #333333;
}
.cp_qa .quest {
	font-weight: bold;
	position: absolute;
	bottom: -1em;
	left: -15em;
	display: inline-block;
	width: 14em;
	text-align: right;
}
.cp_qa .cp_qanda::before {
	font-family: serif;
	font-size: 4em;
	position: absolute;
	top: -0.4em;
	left: -3.7em;
	display: inline-block;
	width: 9em;
	content: 'Q';
	opacity: 0.1;
}
.cp_qa .answer {
	min-height: 3em;
}

copypet.jp

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

More Info

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