Lerne, wie du das Aussehen von Text mit Farben, Schriftarten und Abständen steuerst.
rgb(), rgba()font-family, font-size, font-weighttext-alignunderline, line-throughline-height, letter-spacingp {
color: blue; /* benannter Farbwert */
}
h1 {
color: #FF5733; /* Hex-Code */
}
span {
color: rgba(255, 0, 0, 0.7); /* rgba mit Transparenz */
}
body {
font-family: 'Arial', sans-serif;
font-size: 16px;
}
h2 {
font-weight: bold;
}
h1 {
text-align: center;
}
p.underline {
text-decoration: underline;
}
p.strikethrough {
text-decoration: line-through;
}
p {
line-height: 1.8;
letter-spacing: 1px;
}
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>CSS Tag 2 Übung</title>
<style>
h1 {
text-align: center;
font-weight: bold;
color: #2E86C1;
}
p {
color: rgb(100, 100, 200);
font-family: 'Georgia', serif;
font-size: 18px;
line-height: 1.8;
letter-spacing: 1px;
}
p.underline {
text-decoration: underline;
}
p.strikethrough {
text-decoration: line-through;
}
</style>
</head>
<body>
<h1>CSS Styling Grundlagen</h1>
<p>Dies ist ein normal gestalteter Absatz.</p>
<p class="underline">Dieser Absatz ist unterstrichen.</p>
<p class="strikethrough">Dieser Absatz hat eine Durchstreichung.</p>
</body>
</html>