30 CSS Hero Sections

Product Shot Hero

Apple-keynote product shot — a CSS-painted device front-and-centre with floating feature badges that pulse around it. Ice blue + chrome silver on warm white.

Pure CSS MIT licensed
Live Demo Open in tab
Open in playground

The code

<section class="hs-prd" aria-label="Hero">
  <div class="hs-prd-stage">
    <div class="hs-prd-device" aria-hidden="true">
      <div class="hs-prd-screen"></div>
      <div class="hs-prd-cam"></div>
    </div>
    <span class="hs-prd-pulse hs-prd-p1"><strong>· chip</strong>16-core neural</span>
    <span class="hs-prd-pulse hs-prd-p2"><strong>· battery</strong>22 hours</span>
    <span class="hs-prd-pulse hs-prd-p3"><strong>· weight</strong>1.24 kg</span>
  </div>
  <div class="hs-prd-copy">
    <h2>The lightest pro<br />laptop we've ever <em>shipped.</em></h2>
    <a class="hs-prd-cta" href="#buy">From $1,499 →</a>
  </div>
</section>
.hs-prd {
  display: grid; grid-template-columns: 1.2fr 1fr;
  width: 100%; min-height: 480px;
  padding: clamp(28px, 5vw, 56px);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  background:
    radial-gradient(circle at 30% 30%, #d8e8f0 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, #e8eef2 0%, transparent 50%),
    #f8fafc;
  font-family: 'Inter', system-ui, sans-serif;
  color: #1a2840;
  box-sizing: border-box;
}
.hs-prd-stage {
  position: relative; height: 100%; min-height: 320px;
  display: grid; place-items: center;
}
.hs-prd-device {
  width: 320px; height: 200px;
  background: linear-gradient(160deg, #b8c8d8 0%, #8090a8 50%, #607080 100%);
  border-radius: 14px;
  position: relative;
  box-shadow:
    0 22px 60px rgba(96,112,128,0.4),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -2px 0 rgba(0,0,0,0.18);
}
.hs-prd-screen {
  position: absolute; inset: 8px;
  background: linear-gradient(135deg, #1a2840 0%, #0a1428 100%);
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px #0a1428;
}
.hs-prd-cam {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: #1a2840;
}
.hs-prd-pulse {
  position: absolute;
  background: #fff;
  border: 1px solid #d0d8e0;
  padding: 8px 12px; border-radius: 999px;
  font-size: 12.5px; color: #1a2840;
  display: inline-flex; flex-direction: column; gap: 1px;
  box-shadow: 0 8px 22px rgba(96,112,128,0.18);
  animation: hs-prd-bob 4s ease-in-out infinite;
}
.hs-prd-pulse strong { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #6b85a5; font-weight: 600; letter-spacing: 0.04em; }
.hs-prd-p1 { top: 10%; left: 4%; animation-delay: 0s; }
.hs-prd-p2 { top: 35%; right: 0; animation-delay: -1.3s; }
.hs-prd-p3 { bottom: 12%; left: 12%; animation-delay: -2.6s; }
@keyframes hs-prd-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.hs-prd-copy { padding: 12px 0; }
.hs-prd h2 {
  margin: 0 0 22px;
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
  color: #1a2840;
}
.hs-prd h2 em {
  background: linear-gradient(90deg, #6b85a5, #b8c8d8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic; font-weight: 800;
}
.hs-prd-cta {
  display: inline-block; padding: 13px 24px;
  background: #1a2840; color: #f8fafc;
  border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 14.5px;
  transition: transform 0.15s;
}
.hs-prd-cta:hover { transform: translateY(-1px); }
@media (max-width: 720px) {
  .hs-prd { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-prd-pulse { animation: none; }
  .hs-prd-cta { transition: none; }
}

Search CodeFronts

Loading…