CSS :last-child Pseudo-class
- Προηγούμενη σελίδα :lang()
- Επόμενη σελίδα :last-of-type
- Επιστροφή στο προηγούμενο επίπεδο Εκπαιδευτικός Οδηγός για τα Πseudo-classes του CSS
Definition and Usage
CSS :last-child
Pseudo-classes are used to match any element that is the last child of its parent element.
Tip:p:last-child
is equivalent to p:nth-last-child(1)
.
Example
Specify the background color for the <p> element that is the last child of its parent element. Also specify the background color for the <li> element that is the last child of its parent element:
p:last-child { background-color: yellow; } li:last-child { background-color: yellow; }
CSS Syntax
:last-child { css declarations; }
Technical Details
Version: | CSS3 |
---|
Browser Support
The numbers in the table specify the first browser version to fully support the pseudo-class.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
Σχετικές σελίδες
Παραπομπές:Η ψευδοκλάση :last-of-type του CSS
- Προηγούμενη σελίδα :lang()
- Επόμενη σελίδα :last-of-type
- Επιστροφή στο προηγούμενο επίπεδο Εκπαιδευτικός Οδηγός για τα Πseudo-classes του CSS