Styled Definition List Template

A clean and structured template for presenting glossary terms, metadata, or product specifications.

This component styles the native HTML definition list, aligning terms and their definitions in a highly readable two-column grid on larger screens.

A screenshot of a styled definition list with terms and definitions.

Get Source Code Preview

About this Template

The definition list is a powerful but often overlooked HTML element. This template uses a semantic definition list (dl) with its corresponding term (dt) and definition (dd) elements. For smaller screens, it displays as a stacked list. For larger screens, a media query applies a CSS Grid layout, elegantly arranging the terms and definitions into two distinct columns for easy scanning.

Features

Code Breakdown

The structure consists of a dl element with a class of .definition-list. On small screens, no special layout is applied; the browser's default block-level display for the dt and dd creates a simple, stacked appearance.

A media query for screens wider than 768px applies display: grid to the .definition-list container. The rule grid-template-columns: 1fr 2fr (or similar) is used to divide the space into two columns. The terms (dt) automatically occupy the first column and the definitions (dd) the second, creating the side-by-side layout.

Code

Here's the full code for the template:

View Output