Skip to content

Instantly share code, notes, and snippets.

@Lego2012
Last active February 9, 2017 13:43
Show Gist options
  • Save Lego2012/2fdcb0a8808fd91fed36d29841f224f8 to your computer and use it in GitHub Desktop.
Save Lego2012/2fdcb0a8808fd91fed36d29841f224f8 to your computer and use it in GitHub Desktop.
Erstes oder letztes Element von einem Typ selektieren
article:first-of-type,
article:last-of-type {
margin: 10px 0;
}
/*
Möchten wir von unserem Dokument das insgesamt erste oder letzte Element von einem Typ selektieren, können wir dafür die Pseudoklasse :first-of-type oder :last-of-type benutzen. In unserem Beispiel erhält das letzte und erste article-Element einen Abstand von 10px nach unten und oben.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment