Midterms - Cascading Style Sheets Flashcards
combinator matches all elements that are descendants of a specified element.
descendant (space)
div p { background-color: yellow; }
combinator selects all elements that are the children of a specified element.
Child Combinator (>)
div > p { background-color: yellow; }
combinator is used to select an element that is directly after another specific element
Adjacent Sibling Combinator (+)
combinator selects all elements that are next siblings of a specified element.
General sibling combinator (~)
is used to define a special state of an element.
pseudo-class
The syntax of pseudo-classes:
selector:pseudo-class { property: value; }
pseudo-class matches a specified element that is the first child of another element.
:first-child
pseudo-class allows you to define special rules for different languages
:lang
is used to style specific parts of an element.
pseudo-element
The syntax of pseudo-elements:
selector::pseudo-element { property: value; }
pseudo-element is used to add a special style to the first line of a text.
::first-line
pseudo-element is used to add a special style to the first letter of a text.
::first-letter
pseudo-element can be used to insert some content before the content of an element.
::before
pseudo-element can be used to insert some content after the content of an element.
::after
pseudo-element selects the markers of list items.
::marker