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

パーツ番号 01-02-10 ・ CSSのみ

斜めストライプ背景バナー

斜めのストライプがゆっくり流れる背景にキャッチとボタンを重ねたバナー。飲食店やイベントの予約訴求など、動きで目を引きたい場面に。

autocss

プレビュー

ソースコード

HTML

<div class="d01-02-10-banner">
          <div class="d01-02-10-stripes" aria-hidden="true"></div>
          <div class="d01-02-10-inner">
            <p class="d01-02-10-lead">RESERVATION OPEN</p>
            <h4 class="d01-02-10-title">週末限定ディナー<br>ご予約受付中</h4>
            <a href="#" class="d01-02-10-btn" onclick="return false">席を予約する</a>
          </div>
        </div>

CSS

.prev.d01-02-10{padding:0;overflow:hidden}
        .d01-02-10-banner{position:relative;width:100%;height:260px;display:flex;align-items:center;justify-content:center;background:#111827;overflow:hidden}
        .d01-02-10-stripes{position:absolute;top:-50%;left:-50%;width:200%;height:200%;background:repeating-linear-gradient(45deg,#1f2937 0,#1f2937 24px,#374151 24px,#374151 48px);animation:d01-02-10-move 6s linear infinite}
        @keyframes d01-02-10-move{from{transform:translate(0,0)}to{transform:translate(-48px,-48px)}}
        .d01-02-10-inner{position:relative;z-index:2;text-align:center;color:#fff;padding:0 20px}
        .d01-02-10-lead{font-size:11px;letter-spacing:.24em;color:#fbbf24;font-weight:700;margin-bottom:10px}
        .d01-02-10-title{font-size:21px;font-weight:800;line-height:1.5;margin-bottom:18px;text-shadow:0 2px 10px rgba(0,0,0,.5)}
        .d01-02-10-btn{display:inline-block;padding:12px 28px;border-radius:6px;background:#fbbf24;color:#3b1d00;font-weight:800;font-size:14px;text-decoration:none;transition:transform .2s ease,background .2s ease}
        .d01-02-10-btn:hover{transform:translateY(-2px);background:#fcd34d}

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