Skip to content
Tutorials Center
My learning

Topics

Lesson 131 of 139 ยท Projects

Project: Tribute Page

Build a single-page tribute in four stages with a hero image, a CSS-only timeline, a styled pull quote and a footer, using pseudo-elements, logical properties and custom properties.

A tribute page honors a person, a team or an idea. It is a classic first portfolio project because it needs only one page and one column, yet it practices almost everything in the first half of this course: a hero image, readable typography, a timeline drawn with pseudo-elements, a quote block with personality, and a footer.

In this project you will build a tribute to Marlen Voss, a fictional balloon cartographer who mapped the winds. Every fact on the page is invented, so swap in a real hero of yours when you are done. As in the profile card project, each stage has an editor with the complete code so far.

Stage 1: Markup and a readable page

Start with meaning, not looks. The page uses landmarks (<header>, <main>, <footer>), one <h1>, a <figure> with a caption for the hero image, and an ordered list for the timeline, because the events really are in order.

The first styles set up a calm base: border-box sizing (box-sizing), a serif font with a generous line-height (Line Height), and a max-width on the text column measured in ch units so lines never get longer than about 65 characters (Units). The colors live in custom properties, so you can re-theme the page by changing three lines (Custom Properties).

Stage 1: markup and base styles

Stage 2: A hero that fills the width

The image should be the star. Two things make it work: width: 100%; height: auto keeps it inside its column at any screen size, and border-radius softens the corners (Styling Images).

To make the title feel like a title, the header gets a dark band with centered text. Small uppercase labels use letter-spacing (Styling Text). The caption is made quieter with a smaller, italic style so it does not compete with the picture.

Stage 2: header band and hero image

The negative top margin on the figure (-1.5rem) pulls the image up so it overlaps the dark band slightly. Because the image comes later in the page and is positioned in normal flow, it paints over the band without any z-index (z-index).

Stage 3: A timeline from pseudo-elements

The list of events becomes a vertical timeline using only CSS. The recipe has three parts:

  1. Remove the default numbers with list-style: none and give the list position: relative plus left padding.
  2. Draw the vertical line with ol::before: an absolutely positioned, 3px-wide box that stretches from top to bottom.
  3. Draw one dot per item with li::before, positioned on the line.

The dots and the line are decoration, so they belong in pseudo-elements with content: "", not in the HTML (Pseudo-elements). Positioning is covered in Position.

Stage 3: the timeline

The line sits at left: 0.45rem and each dot is about 0.95rem wide plus its border, so the dot's center falls on the line. If you change the dot size, adjust left by half the difference. This is the kind of arithmetic that calc() and custom properties make easier: store the dot size in --dot and compute the offset (Math Functions).

A pull quote gives the page a voice. Use <blockquote> with a <cite> inside a <footer>, and style it with a thick accent border on the start side and a large decorative quotation mark from ::before. Using the logical property border-inline-start makes it flip automatically in right-to-left languages (Writing Modes).

The page footer gets a soft top border, small centered text and extra space at the bottom. Finally, a :focus-visible outline in the accent color helps keyboard users (Accessibility).

Stage 4: the complete page

The blockquote's <footer> and the page's <footer> need different selectors. Here the page footer has the class site, so blockquote footer and footer.site never collide. Always check that a bare element selector does not catch more elements than you meant (Specificity).

Ideas to take it further

  • Alternate timeline items left and right on wide screens with a media query (Media Queries).
  • Add a dark theme by redefining the three custom properties inside prefers-color-scheme: dark (Dark Mode).
  • Fade the hero in with a short animation, and respect prefers-reduced-motion (Animations).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is the timeline an <ol> and not a <div> for each event?

    HTML should describe the content. A sequence of dated events is an ordered list, and CSS can make it look like any timeline.
  2. 2. What does content: "" do in .timeline::before?

    A ::before box is only created when content is set. An empty string makes an empty box you can size and color.
  3. 3. Which value keeps text lines readable on a wide screen?

    ch is about the width of the digit 0, so a width in ch limits the number of characters per line to a comfortable range.
  4. 4. Why use border-inline-start for the quote bar?

    Logical properties follow the writing direction, so the same CSS works for English and Arabic pages.

Summary

  • Start with semantic HTML (landmarks, figure, ol, blockquote) and add style in layers.
  • Custom properties keep the theme in one place; ch units and clamp() keep type readable.
  • A negative margin creates overlap without z-index.
  • A timeline is a relatively positioned list with an absolutely positioned line (ol::before) and one dot per item (li::before).
  • Logical properties such as border-inline-start keep designs correct in any language.

Next: Project: Contact Us Page, where you lay out an accessible form with grid and style its validation states.