パーツ番号 06-07-10 ・ CSSのみ
ピックアップ+その他記事の2段構成
上段に注目記事を強調表示し、下段に番号付きの記事一覧を続ける構成。人気記事ランキングの表示にも応用できる。
プレビュー
ソースコード
HTML
<div class="pick06-07-10">
<span class="lb06-07-10">PICKUP</span>
<p class="ti06-07-10">今週最も読まれた特集記事はこちら</p>
</div>
<div class="oth06-07-10">
<div class="ot06-07-10"><span class="n06-07-10">1</span><p>朝活を続けるための工夫</p></div>
<div class="ot06-07-10"><span class="n06-07-10">2</span><p>資格取得のロードマップ</p></div>
<div class="ot06-07-10"><span class="n06-07-10">3</span><p>おうちカフェの淹れ方講座</p></div>
</div>CSS
.d06-07-10{display:flex;flex-direction:column;width:100%;gap:12px;}
.d06-07-10 .pick06-07-10{background:linear-gradient(135deg,#2c3e6b,#4a6fd8);border-radius:8px;padding:14px;display:flex;flex-direction:column;gap:6px;}
.d06-07-10 .lb06-07-10{align-self:flex-start;font-size:9px;color:#2c3e6b;background:#ffd166;padding:2px 8px;border-radius:3px;font-weight:bold;}
.d06-07-10 .pick06-07-10 .ti06-07-10{margin:0;font-size:12px;color:#fff;font-weight:bold;line-height:1.4;}
.d06-07-10 .oth06-07-10{display:flex;flex-direction:column;gap:7px;}
.d06-07-10 .ot06-07-10{display:flex;gap:8px;align-items:center;}
.d06-07-10 .n06-07-10{font-size:10px;color:#bbb;font-weight:bold;width:14px;}
.d06-07-10 .ot06-07-10 p{margin:0;font-size:10.5px;color:#333;}クラス名 .d06-07-10 は本ライブラリ内での識別用です。複数のパーツを同じページで使う場合は、重複しないよう名前を変更してください。