CSS Tekst

TEXT FORMATTING

Text formatting

This text is styled with some of the text formatting properties. The heading uses the text-align, text-transform, and color properties. The paragraph is indented, aligned, and the space between characters is specified. The underline is removed from this colored "Try it Yourself" link.

This text uses some text formatting attributes to set the style. The heading uses the text-align, text-transform, and color properties. The paragraph is indented, aligned, and the space between characters is specified. Then from this colorful"Try it Yourself"The underline is removed from the link.

Probeer het zelf

Text color

kleur The attribute is used to set the text color. The color is specified by the following values:

  • Color name - for example "red"
  • Hexadecimal value - for example "#ff0000"
  • RGB-waarden - zoals "rgb(255,0,0)"

Bekijk CSS Kleurwaardengebruiken om een volledige lijst van mogelijke kleurwaarden te verkrijgen.

De standaard tekstkleur van de pagina is gedefinieerd in de body selector.

Voorbeeld

body {
  kleur: blauw;
{}
h1 {
  kleur: groen;
{}

Probeer het zelf

Tip:Voor W3C-compliant CSS: Als je kleur Eigenschap, moet je ook achtergrondkleur eigenschappen gedefinieerd.

tekstkleur en achtergrondkleur

In dit voorbeeld hebben we achtergrondkleur Eigenschappen en kleur Eigenschap:

Voorbeeld

body {
  achtergrondkleur: lichte grijs;
  kleur: blauw;
{}
h1 {
  achtergrondkleur: zwart;
  kleur: wit;
{}

Probeer het zelf