Diese Lektion behandelt Schriftarten, Textformatierung und typografische Eigenschaften in CSS. Richtiges Setzen von Text ist entscheidend für Lesbarkeit und Design.
serif – klassische Schriftarten mit Serifensans-serif – moderne, serifenlose Schriftenmonospace – feste Breite für jedes Zeichencursive – kursiv, dekorativfantasy – ausgefallene, dekorative Schriftenp {
font-family: Arial, Helvetica, sans-serif;
}
h1 {
font-size: 2.5rem;
}
p {
font-size: 16px;
}
font-style: normal | italic | oblique;font-weight: normal | bold | 100–900;em {
font-style: italic;
}
strong {
font-weight: bold;
}
line-height – Zeilenhöheletter-spacing – Abstand zwischen Buchstabenword-spacing – Abstand zwischen Wörternp {
line-height: 1.6;
letter-spacing: 0.05em;
word-spacing: 0.1em;
}
h2 {
text-align: center;
}
p {
text-align: justify;
}
text-decoration: none | underline | overline | line-through;text-transform: uppercase | lowercase | capitalize;a {
text-decoration: none;
text-transform: uppercase;
}
color festgelegt. Hexadezimal, RGB(A) oder HSL Werte sind möglich.
p {
color: #2b7cff;
}
span {
color: rgba(255,0,0,0.8);
}