ヒーローセクション
背景画像に暗めのオーバーレイとキャッチコピー・CTAボタンを重ねた、トップページ向けのヒーローセクションです。
コード・使い方を見る
<div class="hs-hero">
<div class="hs-media">
<img class="hs-img" src="https://placehold.co/1600x700/2f8f9d/ffffff?text=Minato+General+Clinic" alt="みなと総合クリニックの外観" loading="lazy">
<div class="hs-overlay-layer"></div>
</div>
<div class="hs-content">
<p class="hs-eyebrow">みなと総合クリニック</p>
<h1 class="hs-catch">地域のかかりつけ医として、<br class="hs-br">ていねいな診療を。</h1>
<p class="hs-lead">東京都港区0-0-0 / 03-0000-0000</p>
<a class="hs-cta" href="#reserve">診療予約はこちら</a>
</div>
</div> .hs-hero {
--hs-overlay: 0.45; /* 背景画像に重ねる暗さ(0〜1、大きいほど暗い) */
--hs-accent: #2f8f9d; /* CTAボタンの色(医院のテーマ色に変更してください) */
position: relative;
isolation: isolate;
display: flex;
align-items: center;
justify-content: center;
min-height: 480px;
overflow: hidden;
border-radius: 14px;
font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
text-align: center;
color: #fff;
}
.hs-media {
position: absolute;
inset: 0;
z-index: 0;
}
.hs-img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.hs-overlay-layer {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, var(--hs-overlay));
}
.hs-content {
position: relative;
z-index: 1;
padding: 3rem 1.5rem;
max-width: 640px;
}
.hs-eyebrow {
margin: 0 0 .8rem;
font-size: .85rem;
font-weight: 600;
letter-spacing: .18em;
color: #fff;
opacity: .9;
}
.hs-catch {
margin: 0 0 1rem;
font-size: 1.9rem;
font-weight: 800;
line-height: 1.5;
letter-spacing: .03em;
text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.hs-lead {
margin: 0 0 1.8rem;
font-size: .9rem;
opacity: .92;
letter-spacing: .04em;
}
.hs-cta {
display: inline-block;
background: var(--hs-accent);
color: #fff;
font-weight: 700;
font-size: .95rem;
padding: .9em 2.4em;
border-radius: 999px;
text-decoration: none;
letter-spacing: .05em;
box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
transition: transform .15s, box-shadow .15s, opacity .15s;
}
.hs-cta:hover,
.hs-cta:focus-visible {
transform: translateY(-2px);
box-shadow: 0 10px 22px rgba(0, 0, 0, .3);
opacity: .95;
outline: none;
}
@media (max-width: 480px) {
.hs-hero { min-height: 380px; border-radius: 10px; }
.hs-content { padding: 2rem 1.2rem; }
.hs-catch { font-size: 1.4rem; }
.hs-lead { font-size: .8rem; }
.hs-cta { font-size: .88rem; padding: .8em 2em; }
}