HTML Formatterhtmlformatteronline.com

Split hero with image

Text on one side, image on the other, stacking cleanly on mobile.

herolandingsplitimagetwo-column
<section class="split">
  <div class="copy">
    <h1>Cloth you can trace back to the mill</h1>
    <p class="lede">Every shirt we cut lists the mill, the weave and the week it was made.
    Nothing is sourced through a middleman.</p>

    <ul class="points">
      <li>Milled in Yorkshire and northern Portugal</li>
      <li>Cut in runs of fifty, never more</li>
      <li>Sixty days to change your mind</li>
    </ul>

    <div class="actions">
      <a class="btn" href="/shirts/">See the shirts</a>
      <a class="link" href="/mills/">How we choose a mill</a>
    </div>
  </div>

  <div class="art">
    <img src="https://placehold.co/900x1000/e8ecf4/8593ab?text=Linen+on+the+loom"
         alt="A bolt of oatmeal linen on a loom" width="900" height="1000">
  </div>
</section>

How it works

width and height on the image, and aspect-ratio in CSS. Both, not one or the other. The HTML attributes let the browser reserve space before any CSS loads; the CSS property keeps the ratio correct when the width is fluid. Together they mean the page never jumps when the image arrives, which is what Cumulative Layout Shift measures.

The image moves to the top on mobile. order: -1 puts it first below 820 pixels. That is a judgement call — it gives the visitor something to look at immediately, at the cost of pushing the headline down. If your headline is doing the selling, drop the rule.

The ratio changes on mobile too. A 9:10 portrait image is right beside a column of text and wrong stacked above it, where it eats most of the screen before anyone reaches the words. Switching to 16:10 fixes that with one line.

One button and one text link. Two solid buttons side by side make people choose before they know enough. A quiet secondary link gets the same job done without competing.

The grid needs no equal-height tricks. align-items: center vertically centres the shorter column against the taller one. This used to require absolute positioning or a table display.

Accessibility notes

The alt text describes the image, not the file: "A bolt of oatmeal linen on a loom". If the image is purely decorative — a pattern, an abstract shape — use alt="" so it is skipped rather than announced as an unlabelled image.

The bullet list is a real <ul>, so a screen reader announces "list, 3 items" and the user can skip it. The tick marks are pseudo-elements and generate no announcement, which is correct — they carry no information.

Source order matches visual order on desktop. The mobile order: -1 moves the image visually but leaves it after the copy in the DOM, so keyboard and screen reader users still reach the headline first. That is the right way round.

Making it yours

Swap the columns by putting .art first in the markup, or by setting direction on the grid — but changing the source order is better, because it keeps the tab order matching the visual order.

For a screenshot rather than a photo, drop object-fit: cover and use contain so nothing important gets cropped, and add a border so the edge of the screenshot is visible against a white page.

Related templates

Check your version

Once you have edited this, the HTML validator will catch any tag you left unclosed, and the formatter will tidy the indentation. Both run in your browser.