SectionsSimpleApril 14, 2026
Parallax Image Band
A full-width image band with CSS background-attachment: fixed parallax on desktop. Pure CSS, no JavaScript. Configurable section and band heights.
View Full Demo →Preview
Source
demo.jsx
import ParallaxImageBand from "./index.jsx";
import { parallaxImageBand } from "../demo-data.js";
import styles from "./demo.module.css";
export default function ParallaxImageBandDemo() {
return (
<div className={styles.page}>
<div className={styles.spacer} />
<ParallaxImageBand {...parallaxImageBand} />
<div className={styles.spacer} />
</div>
);
}
index.jsx
import styles from "./styles.module.css";
export default function ParallaxImageBand({ image, sectionHeight = "75vh", bandHeight = "50vh" }) {
return (
<section className={styles.section} style={{ height: sectionHeight }}>
<div
className={styles.band}
style={{
height: bandHeight,
backgroundImage: `url(${image})`,
}}
/>
</section>
);
}
demo.module.css
.page {
background: #fff;
}
.spacer {
height: 80vh;
}
styles.module.css
.section {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.band {
width: 100%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
@media (min-width: 768px) {
.band {
background-size: cover;
background-attachment: fixed;
}
}