[パーツ]記事一覧などに使うニュースカード サムネイル画像付きのニュースカード

CSS HTML
 2018.06.26

サムネイル画像付きのニュースカード

背景の画像だけでなくサムネイルの画像がついています。

browser:  65 11 20 10 
ニャン易度 
cover

記事タイトル

サブタイトルやキャッチコピーなど

css html

吾輩は猫である。名前はまだ無い。どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している... read more

<div class="cp_card03">
	<a href="#"><img src="images1.jpg" alt="cover" class="cover" /></a>
	<div class="header">
		<div class="details">
			<h1>記事タイトル</h1>
			<h2>サブタイトルやキャッチコピーなど</h2>
		</div>
	</div>

	<div class="description">
		<div class="column1">
			<span class="tag">css</span>
			<span class="tag">html</span>
		</div>
		<div class="text">
			<p>吾輩は猫である。名前はまだ無い。どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している... <a href="#">read more</a></p>
		</div>
	</div>
</div>
.cp_card03 {
	position: relative;
	margin: 0 auto;
	border-radius: 3px;
	background: #f0f0ed;
	-webkit-box-shadow: 0 3px 7px -3px rgba(0, 0, 0, 0.3);
	        box-shadow: 0 3px 7px -3px rgba(0, 0, 0, 0.3);
}
.cp_card03 .header {
	position: relative;
	z-index: 1;
	overflow: hidden;
	height: 240px;
	margin: 0;
	border-radius: 3px 3px 0 0;
}
.cp_card03 .header::before {
	position: absolute;
	z-index: -1;
	top: 0;
	left: 0;
	overflow: hidden;
	width: 100%;
	height: 100%;
	content: '';
	-webkit-transform: skewY(-3.2deg);
	        transform: skewY(-3.2deg);
	-webkit-transform-origin: 0 0;
	        transform-origin: 0 0;
	background: url('bg_images.jpg');

	-webkit-backface-visibility: hidden;
}
.cp_card03 .cover {
	position: absolute;
	z-index: 2;
	top: 120px;
	left: 20px;
	max-width: 140px;
	height: auto;
}
.cp_card03 .header .details {
	padding: 110px 0 0 180px;
}
.cp_card03 .header .details h1 {
	font-size: 1.4em;
	position: relative;
	margin-bottom: 13px;
	color: #ffffff;
}
.cp_card03 .header .details h2 {
	font-size: 1em;
	font-weight: normal;
	margin-bottom: 15px;
	color: #c7c1ba;
}
.cp_card03 .description {
	padding: 0 0.7em 1em 0;
	color: #8c8b88;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
}
.cp_card03 .description .column1 {
	-webkit-box-flex: 1;
	    -ms-flex: 1;
	        flex: 1;
	height: 100%;
	padding: 70px 0 0 0;
	text-align: center;
}
.cp_card03 .description .text {
	-webkit-box-flex: 2;
	    -ms-flex: 2;
	        flex: 2;
}
.cp_card03 .description .tag {
	font-size: 0.8em;
	margin-right: 4px;
	padding: 3px 8px;
	cursor: pointer;
	border-radius: 10px;
	background: #ffffff;
}
.cp_card03 .description .tag:hover {
	background: #dddddd;
}
.cp_card03 .description a {
	display: block;
	margin-bottom: 10px;
	text-decoration: none;
	color: #039BE5;
}
.cp_card03 .description a::after {
	font-family: FontAwesome;
	margin-left: -10px;
	content: '\f061';
	-webkit-transition: all 0.3s ease;
	        transition: all 0.3s ease;
	vertical-align: middle;
	opacity: 0;
}
.cp_card03 .description a:hover::after {
	margin-left: 5px;
	opacity: 1;
}
@media screen and (max-width: 480px) {
	.cp_card03 .description {
		display: block;
		padding: 0.5em 0.7em;
	}
	.cp_card03 .cover {
		max-width: 100px;
		height: auto;
		top:170px;
		left: 10px;
	}
	.cp_card03 .header .details {
		padding: 150px 0 0 140px;
	}
	.cp_card03 .description .column1 {
		padding: 20px 0 0 0;
	}
}

copypet.jp

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

More Info

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