Skip to content

Split Hero with Diagonal Photo Clip

Pure CSS split hero with headline, buttons and stats beside a full-height photo cut on a diagonal with clip-path, plus an accent stripe and rating badge.

Live preview

Open in new tab

Code

A split hero section in pure CSS with copy on the left and a full-height photo on the right whose inner edge is cut at an angle with clip-path. A thin accent stripe follows the diagonal, and a rating badge floats over the image. It suits travel and tour sites, agencies, outdoor brands and any landing page that needs a strong first impression with a single photo.

How it works

The root section.hdp is a CSS grid. .hdp-copy contains the eyebrow line, the h1.hdp-title with a highlighted .hdp-mark phrase, the .hdp-lead paragraph, two buttons in .hdp-actions and a dl.hdp-stats list. The stat items use flex-direction: column-reverse, so the number appears above its label while the markup keeps the correct dt/dd order.

The photo lives in figure.hdp-media. From 900px the grid has two equal columns and img.hdp-img is absolutely positioned to fill its column with object-fit: cover. The diagonal comes from clip-path: polygon() whose first point is moved right by --hdp-cut. The .hdp-media::before pseudo-element draws the accent stripe as a narrow polygon with the same slope, just left of the photo. On smaller screens the figure moves above the text with order: -1, gets a fixed height and the diagonal flips to the bottom edge, controlled by --hdp-cut-mobile. The figcaption.hdp-badge shows the rating. No JavaScript is used.

The photo comes from Unsplash; replace it with your own image.

Customization

  • --hdp-cut on .hdp: how far the diagonal leans on desktop; 0% gives a straight split, 30% a steep angle.
  • --hdp-cut-mobile: height of the slanted bottom edge of the photo on phones.
  • --hdp-accent: primary button and eyebrow color; --hdp-stripe colors the diagonal stripe separately.
  • --hdp-highlight: marker color behind .hdp-mark and the star in the badge.
  • --hdp-bg and --hdp-ink: background and text color of the copy side.
  • --hdp-min-height: minimum height of the hero on desktop.
  • Remove figcaption.hdp-badge or the dl.hdp-stats block for a cleaner, minimal hero.

Accessibility

The section is labelled by its h1 with aria-labelledby. The photo has a descriptive alt text, width/height attributes and fetchpriority="high" instead of lazy loading, because it is above the fold. The star icon is aria-hidden and the rating is plain text. Statistics use a description list, so label and value stay connected for screen readers. Buttons have a visible amber focus outline, text colors meet WCAG AA contrast on the sand background, and the only motion (a small button lift) is disabled with prefers-reduced-motion: reduce.

Usage notes

clip-path with polygon() is supported in all current browsers. If you only want one h1 per page and already have one, change the heading to h2.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Split Hero with Diagonal Photo Clip – Pure CSS hero sections component screenshot
Split Hero with Diagonal Photo Clip · Pure CSS Hero Sections

More Hero Sections

Hero with Rotating Words – Pure CSS hero sections preview

Hero with Rotating Words

Dark hero section whose headline cycles through words with a slide-and-fade animation, a pause button and decorative stat cards.

Hero with Background Overlay – Bootstrap 5 hero sections preview

Hero with Background Overlay

Full-width Bootstrap 5 hero section with a cover background image, dark gradient overlay, fluid headline, two call-to-action buttons and a stats row.

Centered Hero with Announcement Badge – Tailwind CSS hero sections preview

Centered Hero with Announcement Badge

Dark Tailwind CSS hero section with an announcement pill, gradient headline, two CTA buttons, glowing grid background and a row of trust logos.

Hero with Signup Form – Bootstrap 5 hero sections preview

Hero with Signup Form

Bootstrap 5 two-column hero with value points, social proof and a validated signup card that shows a loading state and a success message.

Split Hero with App Screenshot – Tailwind CSS hero sections preview

Split Hero with App Screenshot

Dark Tailwind CSS split hero with gradient headline, two CTA buttons and an animated mock app dashboard built entirely from divs.