Beispiel:CSS-Einstieg-4.html
Aus SELFHTML-Wiki
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css">
<title>CSS-Einstieg - 4</title>
<style>
main h1 {
margin: 0;
padding: 0;
border: 0 none;
border-radius: 0;
background: none;
background-color: green;
color: white;
}
p {
text-align: center;
color: green;
}
.grey {
background: grey;
}
.darkgrey {
background: darkgrey;
}
.boxes {
display: flex;
gap: 1rem;
width: calc(100% - 1.5rem);
}
.box {
aspect-ratio: 1;
border-radius: 3px;
display: grid;
place-items: center;
width: 150px;
}
</style>
</head>
<body>
<h1>CSS-Einstieg - 4</h1>
<main>
<h1>CSS-Spielwiese - 4</h1>
<p>Dies ist ein Absatz.</p>
<p>Alle Absätze werden über ein Style-Element im <code>head</code> formatiert.</p>
<p>Dies ist noch ein Absatz.</p>
<div class="boxes">
<p> Farbnamen sind nicht immer logisch:</p>
<div class="box grey"><code>grey</code></div>
<div class="box darkgrey"><code>darkgrey</code></div>
</div>
</main>
</body>
</html>