Pseudo-classes Flashcards

1
Q

What do pseudo-classes allow you to do?

A

Apply styles based on state changes and external factors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can pseudo-classes be used in design?

A

They help styles react to user input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does :hover do?

A

Applies styles when a pointing device is placed over an element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When is :active triggered?

A

When an element is actively being interacted with, such as during a click.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does :focus do?

A

Selects an element that can receive focus.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does :focus-within differ from :focus?

A

:focus-within applies styles if any child element inside a parent is focused.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does :target select?

A

An element with an id matching the URL fragment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does :link target?

A

An <a> element with an href that hasn’t been visited yet.</a>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does :visited work?

A

Styles links that have already been visited by the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does :disabled do?

A

Selects and styles disabled form elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When is :checked applied?

A

When a checkbox or radio button is in a checked state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the :indeterminate state?

A

A state where a checkbox, radio button, or <progress> element is neither checked nor unchecked.</progress>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does :placeholder-shown do?

A

Targets a form field with a placeholder but no user-entered value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does :valid do?

A

Styles an input when it has valid data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does :invalid do?

A

Styles an input when it has invalid data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When does :in-range apply?

A

When an input value falls within a specified min and max.

17
Q

What does :first-child select?

A

The first child in a group of sibling elements.

18
Q

How is :first-of-type different from :first-child?

A

:first-of-type selects the first element of a given type among siblings, regardless of other types.

19
Q

How does :nth-child(n) work?

A

Selects the nth child element, with indexing starting at 1.

20
Q

What is :is() used for?

A

A shortcut to group multiple selectors into one.

21
Q

What does :not() do?

A

Excludes elements that match a specified selector.