1/59
Looks like no tags are added yet.
.intro
Selects all elements with class="intro"
.name1.name2
Selects all elements with both name1 and name2 set within its class attribute
.name1 .name2
Selects all elements with name2 that is a descendant of an element with name1
#firstname
Selects the element with id="firstname"
*
Selects all elements
p
Selects all
elements
p.intro
Selects all
elements with class="intro"
div, p
Selects all
elements
div p
Selects all
elements inside
div > p
Selects all
elements where the parent is a
div + p
Selects the first
element that is placed immediately after
p ~ ul
Selects every
element
[target]
Selects all elements with a target attribute
[target="_blank"]
Selects all elements with target="_blank"
[title~="flower"]
Selects all elements with a title attribute containing the word "flower"
[lang|="en"]
Selects all elements with a lang attribute value equal to "en" or starting with "en-"
a[href^="https"]
Selects every element whose href attribute value begins with "https"
a[href$=".pdf"]
Selects every element whose href attribute value ends with ".pdf"
a[href*="w3schools"]
a:active
Selects the active link
p::after
Insert something after the content of each
element
p::before
Insert something before the content of each
element
input:checked
Selects every checked element
input:default
Selects the default element
input:disabled
Selects every disabled element
p:empty
Selects every
element that has no children (including text nodes)
input:enabled
Selects every enabled element
p:first-child
Selects every
element that is the first child of its parent
p::first-letter
Selects the first letter of every
element
p::first-line
Selects the first line of every
element
p:first-of-type
Selects every
element that is the first
element of its parent
input:focus
Selects the input element which has focus
:fullscreen
Selects the element that is in full-screen mode
a:hover
Selects links on mouse over
input:in-range
Selects input elements with a value within a specified range
input:indeterminate
Selects input elements that are in an indeterminate state
input:invalid
Selects all input elements with an invalid value
p:lang(it)
Selects every
element with a lang attribute equal to "it" (Italian)
p:last-child
Selects every
element that is the last child of its parent
p:last-of-type
Selects every
element that is the last
element of its parent
a:link
Selects all unvisited links
::marker
Selects the markers of list items
:not(p)
Selects every element that is not a
element
p:nth-child(2)
Selects every
element that is the second child of its parent
p:nth-last-child(2)
Selects every
element that is the second child of its parent, counting from the last child
p:nth-last-of-type(2)
Selects every
element that is the second
element of its parent, counting from the last child
p:nth-of-type(2)
Selects every
element that is the second
element of its parent
p:only-of-type
Selects every
element that is the only
element of its parent
p:only-child
Selects every
element that is the only child of its parent
input:optional
Selects input elements with no "required" attribute
input:out-of-range
Selects input elements with a value outside a specified range
input::placeholder
Selects input elements with the "placeholder" attribute specified
input:read-only
Selects input elements with the "readonly" attribute specified
input:read-write
Selects input elements with the "readonly" attribute NOT specified
input:required
Selects input elements with the "required" attribute specified
:root
Selects the document's root element
::selection
Selects the portion of an element that is selected by a user
#news:target
Selects the current active #news element (clicked on a URL containing that anchor name)
input:valid
Selects all input elements with a valid value
a:visited
Selects all visited links