Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

CSS Selectors

31

Flashcards

0/31

Still learning
StarStarStarStar

.class

StarStarStarStar

Selects all elements with the class attribute matching 'class'.

StarStarStarStar

*

StarStarStarStar

Selects all elements in the document.

StarStarStarStar

[attribute~='value']

StarStarStarStar

Selects elements with an attribute containing the specified word 'value'.

StarStarStarStar

element1:empty

StarStarStarStar

Selects <element1> that have no children (including text nodes).

StarStarStarStar

element1 element2

StarStarStarStar

Selects all <element2> that are descendants of <element1>.

StarStarStarStar

[attribute^='value']

StarStarStarStar

Selects elements with the specified attribute value beginning with 'value'.

StarStarStarStar

element1:focus

StarStarStarStar

Selects <element1> when it has focus.

StarStarStarStar

element1:last-of-type

StarStarStarStar

Selects the last <element1> of its type in its parent element.

StarStarStarStar

element1::after

StarStarStarStar

Generates a pseudo-element after <element1>'s content.

StarStarStarStar

element1 ~ element2

StarStarStarStar

Selects all <element2> that are siblings of <element1>.

StarStarStarStar

element1:hover

StarStarStarStar

Selects <element1> when the mouse pointer is over it.

StarStarStarStar

element1:first-of-type

StarStarStarStar

Selects the first <element1> in its parent element.

StarStarStarStar

element1::before

StarStarStarStar

Generates a pseudo-element before <element1>'s content.

StarStarStarStar

[attribute='value']

StarStarStarStar

Selects all elements with the specified attribute and value matching 'value'.

StarStarStarStar

[attribute*='value']

StarStarStarStar

Selects elements with the specified attribute value containing the substring 'value'.

StarStarStarStar

element1:active

StarStarStarStar

Selects <element1> when it's being activated by the user (e.g., clicked on).

StarStarStarStar

element1:disabled

StarStarStarStar

Selects <element1> when it is disabled.

StarStarStarStar

element1:checked

StarStarStarStar

Selects <element1> when it is checked (for input elements like checkboxes or radio buttons).

StarStarStarStar

#id

StarStarStarStar

Selects the element with the id attribute matching 'id'.

StarStarStarStar

[attribute]

StarStarStarStar

Selects all elements with the specified attribute.

StarStarStarStar

element1:nth-child(n)

StarStarStarStar

Selects <element1> that is the nth child of its parent.

StarStarStarStar

element1:nth-of-type(n)

StarStarStarStar

Selects <element1> that is the nth of its type in its parent element.

StarStarStarStar

div

StarStarStarStar

Selects all <div> elements.

StarStarStarStar

element1 + element2

StarStarStarStar

Selects the first <element2> that is placed immediately after <element1>.

StarStarStarStar

element1:root

StarStarStarStar

Selects the element that is the root of the document.

StarStarStarStar

[attribute=value]='value']

StarStarStarStar

Selects elements with the specified attribute value ending with 'value'.

StarStarStarStar

element1:first-child

StarStarStarStar

Selects <element1> when it is the first child of its parent.

StarStarStarStar

[attribute|='value']

StarStarStarStar

Selects elements with the specified attribute starting with the value 'value' followed by an optional hyphen.

StarStarStarStar

element1:not(selector)

StarStarStarStar

Selects all <element1> that do not match the 'selector'.

StarStarStarStar

element1 > element2

StarStarStarStar

Selects all <element2> that are direct children of <element1>.

StarStarStarStar

element1:last-child

StarStarStarStar

Selects <element1> when it is the last child of its parent.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.