Landing Section Layout
What it does
Writes the HTML and CSS for one section of a landing page, like services, features or steps. It uses clear headings and even spacing, so visitors can scan it quickly. You can reuse the same pattern for the next section.
When to use it
- You have the basic page and need the middle sections, like services or features
- Your sections are long blocks of text that people skip
- You want one pattern you can reuse instead of designing every section from scratch
The prompt
Act as a front-end developer who values clarity over cleverness. Rules: One clear idea per section. A plain, descriptive heading (not vague hype). Readable line lengths (~60 to 75 chars). Real contrast for legibility, not only to get attention. Consistent vertical rhythm between sections. No manipulation patterns, no fake urgency, no "forces the user to act" language, only a section a tired person can scan and understand.
What this section presents: [SERVICES / FEATURES / PRODUCTS / STEPS]
The items to show: [LIST EACH with a one-line description]
My existing CSS variables (if any): [PASTE, or "none yet"]
Give me:
1. A reusable semantic HTML pattern for one section, filled with my items: heading, supporting line, and a clean grid/list of the items.
2. The CSS for it, using my variables (or sensible defaults), responsive with Grid, no fixed heights that cause overflow.
3. A clear heading hierarchy: how this section's h2/h3 relate to the page's h1, so structure stays logical.
4. The "repeat it" note: exactly what to change to reuse this pattern for the next section, so the page stays consistent.
5. A readability check: line length, contrast, and tap-target size on mobile.
Example
This is a made-up case, and we asked the AI to keep its answer short.
What we filled in:
What this section presents: Services. It's the second section on the home page of my dog walking and pet sitting business in Halifax, right under the hero. The items to show: Group walks: 45-minute walks in groups of up to 4 dogs, weekday mornings and lunchtimes, $22 per walk. Solo walks: 30 minutes one on one for dogs who do better alone, $25. Cat drop-ins: 20 minutes of feeding, litter and company while you are away, $18. Overnight sitting: I stay in your home and keep your pet's normal routine, $75 a night. My existing CSS variables (if any): In :root I have --bg #faf7f2, --text #1f2521, --accent #2f6b4f, --accent-dark #214d38, --space-s 0.75rem, --space-m 1.5rem, --space-l 3rem, --radius 8px, --font-body system-ui, --max-width 72rem. Nothing else yet.
What came back:
1. HTML pattern
<section class="section" aria-labelledby="services-title">
<div class="section__inner">
<h2 class="section__title" id="services-title">Services and prices</h2>
<p class="section__intro">Dog walks, cat visits and overnight pet sitting in Halifax.</p>
<ul class="section__grid">
<li class="card">
<h3 class="card__title">Group walks</h3>
<p>45-minute walks in groups of up to 4 dogs, on weekday mornings and lunchtimes.</p>
<p class="card__price">$22 per walk</p>
</li>
<li class="card">
<h3 class="card__title">Solo walks</h3>
<p>30 minutes one on one, for dogs who do better alone.</p>
<p class="card__price">$25 per walk</p>
</li>
<li class="card">
<h3 class="card__title">Cat drop-ins</h3>
<p>20 minutes of feeding, litter and company while you are away.</p>
<p class="card__price">$18 per visit</p>
</li>
<li class="card">
<h3 class="card__title">Overnight sitting</h3>
<p>I stay in your home and keep your pet's normal routine.</p>
<p class="card__price">$75 a night</p>
</li>
</ul>
<a class="section__link" href="/contact">Ask about availability</a>
</div>
</section>
Point the link at your real contact page.
2. CSS
.section { padding-block: var(--space-l); background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.6; }
.section__inner { max-width: var(--max-width); margin-inline: auto; padding-inline: var(--space-m); }
.section__title { font-size: 1.75rem; line-height: 1.25; margin: 0 0 var(--space-s); }
.section__intro { max-width: 65ch; margin: 0 0 var(--space-m); }
.section__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--space-m); }
@media (min-width: 48rem) { .section__grid { grid-template-columns: repeat(2, 1fr); } }
.card { background: white; border: 1px solid color-mix(in srgb, var(--text) 15%, transparent); border-radius: var(--radius); padding: var(--space-m); }
.card__title { font-size: 1.25rem; line-height: 1.3; margin: 0 0 var(--space-s); }
.card p { max-width: 65ch; margin: 0 0 var(--space-s); }
.card .card__price { margin: 0; font-weight: 700; color: var(--accent-dark); }
.section__link { display: inline-block; margin-top: var(--space-m); padding: var(--space-s) var(--space-m); border-radius: var(--radius); background: var(--accent-dark); color: var(--bg); font-weight: 600; }
.section__link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
One column on phones, two from 48rem up, so the four services sit in a tidy 2 by 2 grid. No heights are set, so cards grow with their text.
3. Heading hierarchy
The page has one h1, in the hero, saying what the business is, for example "[business name]: dog walking and pet sitting in Halifax". This section's title is an h2, like every other main section's. The four services are h3s inside it. Don't skip a level, and don't choose a level for its size. Change the size in CSS instead. Prices stay as paragraphs, not headings.
4. The repeat-it note
Copy the whole section and change only these:
the id on the h2 and the matching aria-labelledby, for example "about-title"
the h2 text and the intro line
the list items and the link, or remove them if the next section doesn't need them
Keep the class names, and never add margin to the section itself. The space between sections comes only from padding-block: var(--space-l), and that's what keeps the rhythm even.
5. Readability check
Line length: the intro and card text stop at 65ch, roughly 60 to 75 characters of normal text. Card lines in the two-column layout run shorter, which is fine for short descriptions.
Contrast: --text on --bg is about 14.6 to 1, and on the white cards about 15.6 to 1. Prices in --accent-dark on white are about 9.6 to 1, and the link text on --accent-dark is about 9 to 1. All are well above the 4.5 to 1 that WCAG AA asks for body text. The --accent focus ring is about 5.9 to 1 against --bg, so it's easy to see.
Tap targets: the link's padding makes it about 50px tall and much wider than that, above the 44 by 44 pixels often recommended. The cards aren't links, so nothing looks tappable that isn't.
Tips
- Keep one idea per section. Squeezing three into one makes the page hard to read.
- Use the same pattern all the way down the page. It makes the site look consistent and well put together.
- Capital letters are fine for a short label of one to three words. A whole sentence in capitals is hard to read.