liveBook · Manning

Font

As explained in Build a Website with ChatGPT

A typeface is a designed set of letterforms and other glyphs that defines the visual style of written text.

A typeface is the shared design of letters, numbers, and symbols. In everyday web design, “font” and “typeface” are often used interchangeably. More precisely, a font is one particular rendering of a typeface: Arial is a typeface, while Arial 16-point bold is a font. section 3.2.2

Fonts help make a page attractive and readable. Choose them as part of the overall design, alongside type size, color, and headings. A useful starting point is to use one typeface for headings and another for ordinary text, provided the pair looks compatible. section 3.0 section 3.2.5

Serif —A serif (rhymes with sheriff) typeface contains fine cross strokes (called feet) at the extremities of each character. These subtle appendages give the typeface a traditional, classy look, but they can get lost when displayed on a screen at small sizes.

Sans serif —A sans-serif typeface doesn’t contain cross strokes on the extremities of characters. These typefaces usually have a clean, modern look that’s well suited to screen text, particularly at small sizes.

Monospace —A monospace typeface (also called a fixed-width typeface) uses the same amount of space for each character, so skinny letters such as i and l take up as much space as wider letters such as m and w.

Cursive —The cursive typefaces are designed to resemble handwritten pen or brush writing.

Fantasy —Fantasy typefaces usually are fanciful designs that have some extreme elements (such as being extra-thick).

These five generic typeface categories are available in every browser. Serif styles have small cross strokes; sans-serif styles are clean and often suit small screen text; monospace gives every character equal width; cursive resembles handwriting; and fantasy uses more extreme, decorative designs. section 3.2.2

In CSS, set a typeface with the font-family property. Use quotation marks around a name that contains spaces. You can also list more than one choice, separated in order of preference. The browser tries the first installed typeface, then moves left to right through the fallback list. section 3.2.2

Use a fallback typeface

font-family: 'Roboto Serif', serif; This asks for Roboto Serif first. If that typeface is unavailable on a visitor’s device, the browser uses its generic serif typeface instead. A generic fallback helps preserve the intended broad style when a named typeface cannot load. section 3.2.2

For a more distinctive pairing, ask ChatGPT for compatible heading and text typefaces from Google Fonts. Describe the page theme, request serif or sans-serif styles for each role, and name any common choices you want to avoid. Review the suggestions and ask again if they do not fit the design. section 3.2.5

Prompt for a font pair

Ask for one Google Fonts typeface for headings and a compatible typeface for page text, based on your page theme. Specify whether each should be serif or sans serif, and optionally exclude Roboto and Open Sans for less familiar suggestions. section 3.2.5

When requesting a web page, include the fonts for headings and regular text in the formatting instructions, along with sizes and colors. Save the generated HTML as index.html and the CSS in the stylesheet named by the HTML, often styles.css, in the same folder. section 3.2.8 section 3.5

How Build a Website with ChatGPT covers it

How deep it goes
Defines typeface versus font and explains CSS family selection, generic categories, and fallback order without deeper typography internals.
Examples
Uses Arial 16-point bold, Roboto Serif with serif fallback, and heading/text pair suggestions from Google Fonts.
What it assumes
Teaches font terminology from zero while using simple CSS declarations and generated HTML/CSS files.
What you can do after
Apply it via CSS and ChatGPT prompts to select heading and text typefaces with browser-safe fallbacks.
How it connects
Connects typefaces with CSS font-family, type size, type style, colors, headings, and Google Fonts.

Also explained in

Compare how 6 books explain font →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.