<a>s which are direct descendants of <p>s Child Selector
h1 + p
The first <p>s which are adjacent to <h1>s Adjacent Sibling Selector
h1 ~ p
All <p>s which come after <h1>s General Sibling Selector
Pseudo Classes [Pseudoklassen]
CSS
Description
a:hover
<a> elements on mouse contact
a:focus
<a> elements when they are focused
a:visited
<a> elements when they have been visited
a:first-child
The first <a> element
a:nth-child(3)
The third <a> element
a:nth-child(odd/even)
Odd/even <a> element
a:nth-child(3n + 4)
Each 3rd <a> starting after the 4th
a:last-child
The last <a> element
Pseudo Elements [Pseudoelementen]
CSS
Description
p::first-line
The first line of all <p> elements
p::first-letter
The first letter of all <p> elements
p::before
Content before all <p> elements
p::after
Content after all <p> elements
Classes vs. ID's
Defined by class= in the HTML and selected using . in CSS
Can be used multiple times
<style>.red {
color: red;
}
.crossed {
text-decoration: line-through ;
}
</style><pclass="red">I am red</p><pclass="red">I am red</p><pclass="blue">I am blue</p><pclass="red crossed">I am red and crossed</p>
Classes vs. ID's
Defined by id= in the HTML and selected using # in CSS