← 静的パーツギャラリーへ戻る

パーツ番号 03-16-02 ・ CSSのみ

一致部分を太字強調した候補リスト

入力中のキーワードと一致する文字だけ太字にした静止候補パネルです。WordPress検索結果ページの入力補助UIでどこが一致しているか視覚的に示す際の参考になります。

staticcss

プレビュー

ソースコード

HTML

<div class="d03-16-02-stage">
          <div class="d03-16-02-bar">
            <svg viewBox="0 0 20 20" width="14" height="14" fill="none" stroke="#94a3b8" stroke-width="1.8"><circle cx="8.5" cy="8.5" r="5.5"/><path d="M17 17l-4-4"/></svg>
            <span class="d03-16-02-text">イヤホン</span>
          </div>
          <div class="d03-16-02-drop">
            <span class="d03-16-02-item"><b>イヤホン</b> 完全ワイヤレス</span>
            <span class="d03-16-02-item"><b>イヤホン</b> Bluetooth 5.3</span>
            <span class="d03-16-02-item">防水 <b>イヤホン</b> スポーツ用</span>
            <span class="d03-16-02-item">子供用 <b>イヤホン</b> 有線</span>
          </div>
        </div>

CSS

.prev.d03-16-02{padding:0;display:block}
        .d03-16-02-stage{
          width:100%;height:100%;min-height:260px;box-sizing:border-box;
          background:#f1f5f9;padding:24px;position:relative;
        }
        .d03-16-02-bar{
          display:flex;align-items:center;gap:9px;background:#fff;border-radius:10px;
          border:1px solid #2563eb;padding:11px 14px;box-shadow:0 0 0 3px #dbeafe;
        }
        .d03-16-02-text{font-size:12.5px;color:#1e293b;font-weight:600}
        .d03-16-02-drop{
          position:absolute;left:24px;right:24px;top:66px;
          background:#fff;border-radius:10px;border:1px solid #e2e8f0;
          box-shadow:0 10px 24px rgba(15,23,42,.1);padding:6px 0;
          display:flex;flex-direction:column;
        }
        .d03-16-02-item{padding:8px 14px;font-size:12px;color:#94a3b8}
        .d03-16-02-item b{color:#2563eb;font-weight:800}

クラス名 .d03-16-02 は本ライブラリ内での識別用です。複数のパーツを同じページで使う場合は、重複しないよう名前を変更してください。