Starlit Daily

📚 › CSS: style and layout

3. Colours and text

Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.

Colours can be a name such as red, a hex code such as #1e90ff, or rgb(30, 144, 255). color sets the text colour and background-color sets the background.

font-size changes text size. px is fixed pixels; rem is relative to the root font size, which makes text easier to scale.

Ver ejemplo

p {
  color: #1e3a8a;
  font-size: 1.1rem;
}

✍️ Ahora te toca

Give the .note class a yellow background and a font size of 20px.

← Volver al curso