CSS Selectors Flashcards
CSS
Cascading Style Sheets
comments
/(asterisk) (asterisk)/
external style sheet linking syntax
Link Href="..." Rel="stylesheet" type="text/css" Media="all" /link
element selector
E
universal selector
*
class selector
.class
Id selector
id
targeting a specific element with a class
E.class
grouping multiple selectors
E, F, G
descendant selector (does not need to be a direct child)
E (space) F
negation selector
E:not(x)
direct child selectors
E > F
immediate adjacent selector
E + F
immediate predecessor selector
E ~ F
selects all elements with the attribute
[attribute]
selects all elements with the attribute value
[attribute=”value”]
element whose attribute value is a list of whitespace-separated values, one of which is exactly equal to “value”
E[attribute~=”value”]
element whose attribute value begins with exactly the string”value”
E[attribute^=”value”]
element whose attribute value ends with exactly the string “value”
E[attribute$=”value”]
element whose attribute value has the substring “value” in it at all
E[attribute*=”value”]
element whose attribute value has hyphen seperated text including the string “value”
E[attribute|=”value”]
not yet visited link
a:link
visited link
a:visited