Advanced Selectors Flashcards

1
Q

[att^=”val”]

A

“begins with” selector

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

[att$=”val”]

A

“ends with” selector

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

[att*=”val”]

A

“contains” selector

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

:nth-child(an+b)
:nth-child(even)
:nth-child(-n+4)
:nth-last-child(n+3)

A
  • targets the even list items only
  • targets the first 4 list items only
  • targets the last 3 list items only
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

:root

A
  • selects the element that is the root of the document.
  • this will usually be the HTML element because it is the root of our document
  • more specificity than the HTML type selector
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

:target

A
  • targets an element only if its ID matches the hash in a URL
  • fragment identifiers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

:empty

A

targets elements that have no child elements or content whatsoever

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

:not()

A

negation pseudo-class that selects everything except the element we specify, and we can use it with just about any type of selector

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

:enabled

A

selects UI elements that are in an enabled state

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

:disabled

A

selects UI elements like buttons and form inputs that are in a disabled state

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

:checked

A

selects UI elements that are in a checked state, such as a text box or a radio button

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

::first-line

A

selects the first line of text rendered by the browser

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

::first-letter

A

selects the very first character, or letter, of the first line of text

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

::before and ::after

A
  • inserts generated content into a page
  • they both work the same way, except that one inserts the content before the element and the other inserts the content after
  • for these pseudo-elements to work properly, we must use the content property
  • at the very least the content property must contain an empty set of quotes as its value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How is generated content rendered in the browser?

A

it appears as child content before or after an element’s content

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

Y/N: Should we use quotes around the content property’s value if we’re defining a function, such as url() or attr()?

A

No