Lesson 22 / Page Types

Item Listing and Details

Time
49 min
Type
Reading + Practice
Level
Intermediate
Use
Core

Design listing pages and detail pages that help users browse, compare, evaluate, and take action.

Course Role

Core

Part of the main course path. Prioritize this before moving to optional polish or deeper references.

Teacher Notes / In-Class Use

Demo Live

  • Model the core workflow from the lesson using a small class example.
  • Connect the example back to the first goal: Explain how listing pages and detail pages work together

Try In Class

  • Build one semantic listing card with `article`, `h2`, `img`, and a clear link.
  • Have students make one visible change, save, refresh, and explain what changed.

Submit Or Check

  • Ask students to show the work in the browser, not only in the editor.
  • Have students commit their progress with a clear message when the checkpoint is stable.

Watch For

  • Students copying code without checking file paths, spelling, or capitalization.
  • Visual changes that work locally but break when the project is published.

Learning Goals

  • Explain how listing pages and detail pages work together
  • Choose between `grid`, `list`, table, and hybrid listing layouts
  • Build semantic item cards, filters, sorting controls, pagination, empty states, and detail-page sections

Introduction

A listing page helps users browse, compare, filter, and choose from many items. A detail page helps users evaluate one item and decide what to do next.

These two page types usually work as a pair. The listing page helps users find an item, and the detail page gives them enough information to act.

Listing Page vs Detail Page

Page TypePrimary JobUser ActionsConnects To
Listing pageShow many related itemsBrowse, compare, filter, sort, searchDetail pages
Detail pageExplain one item in depthEvaluate, save, contact, buy, apply, view moreListing page, related items, next action

User Goals

Before designing the layout, decide what users need to accomplish. The page structure should support those goals directly.

  • Find a specific item quickly.
  • Compare several options.
  • Narrow choices with filter controls.
  • Change order with sort controls.
  • Understand one item deeply on a detail page.
  • Take a clear next action.

Listing Page Anatomy

  • Clear page title and short description.
  • Result count, such as 24 projects or 8 articles.
  • filter controls for narrowing the set.
  • sort controls for changing item order.
  • Item cards, rows, or table entries.
  • pagination, load more, or infinite scroll when there are many items.
  • Empty state when no items match.
  • Selected filter summary and reset action.

Detail Page Anatomy

  • Title or item name.
  • Media, gallery, or featured image.
  • Short summary or value proposition.
  • Key details, specs, tags, metadata, or attributes.
  • Primary call to action.
  • Supporting content such as description, process, reviews, or requirements.
  • Related items, next item, or back link.
  • Breadcrumbs when the site hierarchy is deep.

Choosing a Listing Layout

LayoutBest ForWhy
gridVisual browsingImages and cards can be scanned quickly.
listDetail-heavy comparisonRows allow more text and metadata per item.
TableDense structured dataColumns make precise comparison easier.
Map/list hybridLocation-based contentUsers compare places by geography and details.

Semantic Item Card Markup

Use a list for a group of related items. Each item can contain an article with a clear heading, image, summary, and link.

<ul class="item-grid">
  <li>
    <article class="item-card">
      <img
        src="portfolio-dashboard.webp"
        width="640"
        height="420"
        alt="Dashboard project with charts and activity cards"
      >
      <h2>
        <a href="portfolio-dashboard.html">Portfolio Dashboard</a>
      </h2>
      <p>A responsive dashboard interface for tracking project progress.</p>
      <p class="item-meta">UI Design � Responsive Layout</p>
    </article>
  </li>
</ul>

Grid Layout CSS

A responsive grid works well for visual browsing. Use gap for spacing and stable image dimensions to avoid layout shift.

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-card img {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  object-fit: cover;
}

List Layout Markup

A list layout is better when the summary, metadata, or comparison details matter more than the image grid.

<ul class="item-list">
  <li>
    <article class="item-row">
      <img
        src="course-card.webp"
        width="240"
        height="160"
        alt="Course landing page with pricing cards"
      >
      <div>
        <h2><a href="course-landing-page.html">Course Landing Page</a></h2>
        <p>Landing page design with pricing, testimonials, and enrollment CTA.</p>
        <p class="item-meta">Landing Page � HTML � CSS</p>
      </div>
    </article>
  </li>
</ul>

List Layout CSS

.item-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1rem;
  align-items: start;
}

.item-row img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

Filter and Sort Controls

Filters and sorting controls should use real form controls with labels. This keeps the interface understandable and keyboard accessible.

<form class="listing-controls" aria-label="Project filters">
  <label for="category">Category</label>
  <select id="category" name="category">
    <option value="">All categories</option>
    <option value="web">Web design</option>
    <option value="app">App design</option>
  </select>

  <fieldset>
    <legend>Features</legend>
    <label><input type="checkbox" name="feature" value="responsive"> Responsive</label>
    <label><input type="checkbox" name="feature" value="animation"> Animation</label>
  </fieldset>

  <label for="sort">Sort by</label>
  <select id="sort" name="sort">
    <option value="newest">Newest</option>
    <option value="name">Name</option>
  </select>
</form>

Pagination

Use nav with aria-label for pagination. Mark the current page with aria-current="page".

<nav class="pagination" aria-label="Pagination">
  <a href="?page=1">Previous</a>
  <a href="?page=1">1</a>
  <a href="?page=2" aria-current="page">2</a>
  <a href="?page=3">3</a>
  <a href="?page=3">Next</a>
</nav>

Empty State

An empty state explains what happened and gives users a way to recover. This is especially important when filters return no results.

<section class="empty-state" aria-live="polite">
  <h2>No projects match these filters</h2>
  <p>Try removing a filter or viewing all projects.</p>
  <a href="/work/">Reset filters</a>
</section>

Detail Page Structure

A detail page should answer the user's biggest questions first, then provide supporting information and a clear next step.

<article class="project-detail">
  <a href="/work/">Back to all projects</a>
  <h1>Portfolio Dashboard</h1>
  <p>A responsive dashboard interface for tracking project progress.</p>

  <img
    src="portfolio-dashboard-large.webp"
    width="1200"
    height="800"
    alt="Portfolio dashboard interface with charts and project cards"
  >

  <dl>
    <div>
      <dt>Role</dt>
      <dd>UX design and front-end development</dd>
    </div>
    <div>
      <dt>Tools</dt>
      <dd>HTML, CSS, JavaScript</dd>
    </div>
  </dl>

  <a href="/contact/">Start a project</a>
</article>

Accessibility Guidance

  • Make card links clear. The link text should identify the item, not just say View more.
  • Avoid putting buttons, selects, or other interactive controls inside one giant card link.
  • Use labels for every filter and sort control.
  • Use aria-current="page" for the current pagination link.
  • Use meaningful alt text for informative images and empty alt="" for decorative images.
  • Preserve logical heading order, such as h1 for the page title and h2 for item titles.

Advanced Layout Note

Masonry layouts can look interesting, but they can also create confusing reading order and uneven keyboard flow. Treat Masonry or Isotope-style layouts as advanced patterns and test them carefully.

Common Mistakes

MistakeWhy It HurtsFix
Cards with vague linksUsers cannot predict where the link goesUse the item title as the main link.
No empty stateUsers may think the page is brokenExplain no results and provide a reset action.
Filters without labelsControls are harder to understand and usePair each filter with a visible label or legend.
Layout shifts from imagesCards jump while images loadUse image dimensions and stable aspect ratios.
Pagination without accessible labelsUsers may not understand page navigationUse nav aria-label="Pagination" and aria-current.
Detail page missing a clear CTAUsers do not know the next stepAdd one primary action near the decision point.
Too many items without filtering or searchUsers cannot narrow choicesAdd filters, search, sort, or pagination.

Checkpoint

Before moving on, make sure these feel true.

  • I can explain the main concept in my own words.
  • I can apply this lesson to my current project.
  • I can verify the result in the browser.
  • I can commit the change with a clear message.

Project Connection

This lesson supports current class projects.

Practice

  • Build one semantic listing card with article, h2, img, and a clear link.
  • Create both a grid and list variation for the same items.
  • Add filter and sort controls with form, label, select, and checkboxes.
  • Add pagination or a load-more pattern.
  • Design an empty state for no matching results.
  • Sketch the information hierarchy for a product or project detail page.
  • Add related items, breadcrumbs, or a back link to a detail page.