a
This commit is contained in:
43
WS24_25/WebTech/ue4/4/seite.html
Normal file
43
WS24_25/WebTech/ue4/4/seite.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>CSS schreiben</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h2>Überschrift</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>background-color</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1.</td>
|
||||
<td>lightblue</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2.</td>
|
||||
<td>white</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3.</td>
|
||||
<td>lightblue</td>
|
||||
</tr>
|
||||
</table>
|
||||
<section>
|
||||
<h2>Sektionsüberschrift</h2>
|
||||
<p>Der erste Absatz.</p>
|
||||
<p>Der zweite Absatz.</p>
|
||||
<section>
|
||||
<h2>Noch eine Sektionsüberschrift</h2>
|
||||
<p>Der dritte Absatz.</p>
|
||||
<p>Der vierte Absatz.</p>
|
||||
</section>
|
||||
<p>Der fünfte Absatz.</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
25
WS24_25/WebTech/ue4/4/style.css
Normal file
25
WS24_25/WebTech/ue4/4/style.css
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Tabellenkopf in roter Schrift */
|
||||
th {
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* Abwechselnde Zeilenfarben in der Tabelle: lightblue und white */
|
||||
tr:nth-child(even) td {
|
||||
background-color: lightblue;
|
||||
}
|
||||
|
||||
tr:nth-child(odd) td {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
/* Hintergrundfarbe für die Absätze 2, 4 und 5 auf gelb setzen */
|
||||
/* section > p:nth-of-type(2),
|
||||
section > section > p:nth-of-type(2),
|
||||
section > p:nth-of-type(3) {
|
||||
background-color: yellow;
|
||||
} */
|
||||
|
||||
/* Gelber Hintergrund für alle Absätze außer dem ersten in jeder Section */
|
||||
section p:not(:first-of-type) {
|
||||
background-color: yellow;
|
||||
}
|
||||
Reference in New Issue
Block a user