Das erste "Kind" eines Elements: first-child
Spricht innerhalb der Dokumentenstruktur das erste Kind eines HTML-Tags an. In einer <ul>-Liste ist der erste Eintrag das erste Kind und kann mit :first-child anders formatiert werden.
<style type="text/css">
li:first-child{color:#ff0000}
</style>
</head>
<body>
<ul>
<li>1. Eintrag</li>
<li>2. Eintrag</li>
<li>3. Eintrag</li>
</ul>
</body>
| Anwendbar auf: | Alle Elemente |
| Werte: | Alle Stylesheet-Angaben |
| Wert | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
||||
| 5/5.5/6 | MAC 5+ | 7+ | 5/6 | 7+ | 4 | 6+ | 1+ | 0.8+ | 1.0+ | 3.3+ | |
| n | n | j | n | j | n | j | j | j | j | j | |






