CSS implementation guide · Art and the City · Updated 24 November 2026
From a type scale to usable CSS
The generator provides font-size variables. A working typography system also needs rules for line height, readable text width and responsive headings. This guide connects those pieces without tying your HTML structure to a particular visual size.
Copy the variables into your stylesheet
Choose a base and ratio in the generator, then use Copy CSS. Paste the resulting :root block once into your main stylesheet, before the component rules that use it. The example below uses a 16-pixel base and a 1.25 ratio; the values are rounded.
html { font-size: 100%; }
:root {
--font-base: 1rem;
--font-small: 0.8rem;
--font-h4: 1.563rem;
--font-h3: 1.953rem;
--font-h2: 2.441rem;
--font-h1: 3.052rem;
}
body { font-size: var(--font-base); line-height: 1.6; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, var(--font-h1)); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, var(--font-h2)); line-height: 1.2; }
h3 { font-size: var(--font-h3); line-height: 1.25; }
.caption { font-size: var(--font-small); line-height: 1.5; }
.prose { max-width: 65ch; margin-inline: auto; padding-inline: 1rem; }
p { margin-block: 0 1em; }
Understand what rem means here
The generator divides each pixel size by 16 to produce rem values. That assumes a 16-pixel root when comparing the numeric pixel preview with the CSS. For example, 25 pixels becomes approximately 1.563rem. If your site sets the root to another size, the rendered result will differ.
Keeping html { font-size: 100%; } respects the browser’s default size. A visitor can choose a larger default, so the final pixel size may intentionally change. Do not force the root to 10 pixels merely to make the arithmetic easier.
Make the headline responsive, not the whole page smaller
In the H1 rule, clamp() chooses a value between 2rem and the generated H1 maximum, with 1.5rem + 2vw as the preferred size. The rem term responds to the root size; the viewport term introduces gradual growth. These are starting values for a layout, not a universal accessibility solution.
If the title still overflows, check long words, container padding and fixed widths. Do not hide the overflow to conceal the text. Read MDN’s clamp reference for the syntax.
Keep structure and appearance separate
Use H1, H2 and H3 for the document outline. A large promotional sentence can be a paragraph with a display class. A visually small section heading can still be an H2. The generator’s H4 variable is available, but the example does not require an H4 element just to use that size.
Check the result before reusing it everywhere
- Load real content, including a long heading, a list and a form label.
- Check a narrow viewport and a large desktop width.
- Zoom to 200% and confirm that text and controls remain usable.
- Increase the browser’s default font size and check again.
- Inspect line wrapping and avoid fixed-height text containers.
W3C’s guidance on resizing text and reflow explains these checks. Choosing rem units alone does not establish accessibility.
When the copied CSS seems to do nothing
Check that the variables are inside :root, the stylesheet is loaded, and the component actually uses var(--font-h1). Inspect the browser’s computed styles for a later rule overriding your heading. In WordPress or a page builder, a widget’s typography setting may take precedence. Clear the relevant cache only after confirming that the saved stylesheet contains your change.
Compare example scales · Plan the hierarchy · Generate your variables
CSS-gids · Art and the City · Bijgewerkt 24 november 2026
Van typografieschaal naar bruikbare CSS
De generator geeft variabelen voor lettergroottes. Een werkend systeem heeft daarnaast regelafstand, een leesbare tekstbreedte en passende mobiele koppen nodig. Zo breng je die onderdelen bij elkaar.
Kopieer de variabelen naar je stylesheet
Kies basis en verhouding in de generator en klik op Kopieer CSS. Plaats het :root-blok eenmaal in de algemene stylesheet, vóór de regels die de variabelen gebruiken. Dit voorbeeld gebruikt basis 16 pixels en verhouding 1,25; de waarden zijn afgerond.
html { font-size: 100%; }
:root {
--font-base: 1rem;
--font-small: 0.8rem;
--font-h4: 1.563rem;
--font-h3: 1.953rem;
--font-h2: 2.441rem;
--font-h1: 3.052rem;
}
body { font-size: var(--font-base); line-height: 1.6; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, var(--font-h1)); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, var(--font-h2)); line-height: 1.2; }
h3 { font-size: var(--font-h3); line-height: 1.25; }
.caption { font-size: var(--font-small); line-height: 1.5; }
.prose { max-width: 65ch; margin-inline: auto; padding-inline: 1rem; }
p { margin-block: 0 1em; }
Wat rem hier betekent
De generator deelt de pixelgrootte door 16 om rem te berekenen. De vergelijking met de pixelpreview gaat dus uit van een rootgrootte van 16 pixels. Zo wordt 25 pixels ongeveer 1,563rem. Heeft je website een andere rootgrootte, dan wijkt de zichtbare grootte af.
Met html { font-size: 100%; } volg je de standaardinstelling van de browser. Een bezoeker kan een grotere standaard kiezen; de uiteindelijke pixelgrootte verandert dan bewust mee. Zet de root niet op 10 pixels alleen om eenvoudiger te rekenen.
Laat een grote kop begrensd meegroeien
In de H1-regel kiest clamp() een waarde tussen 2rem en de gegenereerde H1-grootte. De voorkeurswaarde 1.5rem + 2vw combineert een rootgebonden deel met een deel dat de vensterbreedte volgt. Dit zijn beginwaarden voor een ontwerp, geen algemene toegankelijkheidsgarantie.
Loopt de titel nog uit de kolom? Controleer lange woorden, vaste breedtes en padding. Verberg de overloop niet om de tekst weg te werken. Bekijk de MDN-uitleg over clamp.
Houd inhoudelijke structuur en vorm los van elkaar
Gebruik H1, H2 en H3 voor de structuur van het document. Een grote promotiezin kan een alinea met een displayklasse zijn. Een kleine sectiekop kan gewoon H2 blijven. Een beschikbare H4-variabele betekent niet dat je een H4-element moet toevoegen.
Test met echte inhoud
- Gebruik een lange titel, lijst en formulierlabel.
- Controleer een smal venster en een breed scherm.
- Controleer bij 200% zoom of tekst en bediening bruikbaar blijven.
- Vergroot ook de standaardlettergrootte van de browser.
- Vermijd vaste hoogtes rond teksten die over meerdere regels kunnen lopen.
Lees voor de achtergrond W3C over tekst vergroten en reflow. Alleen rem gebruiken is niet genoeg.
Doet de gekopieerde CSS niets?
Controleer of de stylesheet geladen is, de variabelen binnen :root staan en de kop daadwerkelijk var(--font-h1) gebruikt. Bekijk bij de berekende browserstijlen of een latere regel de instelling overschrijft. In WordPress kan de typografie van een widget voorgaan. Controleer eerst de opgeslagen CSS voordat je de relevante cache leegt.
Voorbeelden vergelijken · Hiërarchie kiezen · Variabelen genereren
Guía CSS · Art and the City · Actualizada el 24 de noviembre de 2026
De una escala tipográfica a CSS utilizable
El generador entrega variables de tamaño. Un sistema completo también necesita interlineado, una anchura cómoda de lectura y titulares adaptables. Aquí puedes conectar esas decisiones.
Pega las variables en la hoja de estilos
Elige base y proporción en el generador y copia el CSS. Coloca el bloque :root una vez en tu hoja principal, antes de las reglas que lo usan. Este ejemplo utiliza base 16 y proporción 1,25, con valores redondeados.
html { font-size: 100%; }
:root {
--font-base: 1rem;
--font-small: 0.8rem;
--font-h4: 1.563rem;
--font-h3: 1.953rem;
--font-h2: 2.441rem;
--font-h1: 3.052rem;
}
body { font-size: var(--font-base); line-height: 1.6; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, var(--font-h1)); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, var(--font-h2)); line-height: 1.2; }
h3 { font-size: var(--font-h3); line-height: 1.25; }
.caption { font-size: var(--font-small); line-height: 1.5; }
.prose { max-width: 65ch; margin-inline: auto; padding-inline: 1rem; }
p { margin-block: 0 1em; }
Cómo se calculan los rem
El generador divide el tamaño en píxeles por 16. La comparación con la vista previa supone una raíz de 16 píxeles: 25 píxeles son aproximadamente 1,563rem. Si tu web cambia el tamaño raíz, el resultado visual será distinto.
html { font-size: 100%; } sigue el tamaño predeterminado del navegador. Si una persona prefiere una letra mayor, el resultado puede crecer. No fuerces una raíz de 10 píxeles solo para simplificar las cuentas.
Un titular fluido con límites
La regla H1 utiliza clamp() entre 2rem y el máximo generado. El valor preferido 1.5rem + 2vw combina una parte relativa a la raíz con otra relativa a la ventana. Son valores iniciales para probar, no una garantía de accesibilidad.
Si un título desborda, revisa palabras largas, anchuras fijas y padding. No ocultes el contenido mediante overflow. Consulta la referencia de clamp en MDN.
Estructura y apariencia son decisiones distintas
Utiliza H1, H2 y H3 para organizar el documento. Una frase promocional grande puede ser un párrafo con una clase display. Un título de sección pequeño puede seguir siendo H2. No necesitas crear un H4 solo porque exista una variable con ese nombre.
Comprueba el sistema
- Introduce un título largo, una lista y una etiqueta de formulario.
- Revisa una ventana estrecha y una pantalla ancha.
- Prueba al 200% de zoom sin perder texto ni controles.
- Aumenta también el tamaño predeterminado del navegador.
- Evita contenedores de texto con altura fija.
W3C explica las pruebas de ampliación del texto y reflow. Usar rem no basta por sí solo.
Si el CSS no cambia nada
Comprueba que la hoja está cargada, las variables están dentro de :root y el componente utiliza var(--font-h1). Revisa los estilos calculados: una regla posterior puede sobrescribir el tamaño. En WordPress, la configuración del widget puede tener prioridad. Confirma primero que el CSS guardado contiene el cambio antes de vaciar la caché correspondiente.
Comparar ejemplos · Elegir la jerarquía · Generar variables