selectors Flashcards
.class
Selects all elements with class=”intro”
id
Selects the element with id=”firstname”
*
Selects all elements
element
Selects all < > elements
element,element
Selects all <> elements and all <> elements
element element
Selects all <> elements inside <> elements
element>element
Selects all <> elements where the parent is a <> element
element+element
Selects all <> elements that are placed immediately after <> elements
element1~element2
Selects every <> element that are preceded by a <> element
[attribute]
Selects all elements with a target attribute
[attribute=value]
Selects all elements with —– =”_blank”
[attribute~=value]
Selects all elements with a title attribute containing the word “ —– “
[attribute|=value]
Selects all elements with a lang attribute value starting with “—–”
[attribute^=value]
Selects every element whose —- attribute value begins with “—-“
[attribute$=value]
Selects every element whose —- attribute value ends with “——”