CSS - CSS Selectors

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

60 Terms

1
New cards

.intro

Selects all elements with class="intro"

2
New cards

.name1.name2

Selects all elements with both name1 and name2 set within its class attribute

3
New cards

.name1 .name2

Selects all elements with name2 that is a descendant of an element with name1

4
New cards

#firstname

Selects the element with id="firstname"

5
New cards

*

Selects all elements

6
New cards

p

Selects all

elements

7
New cards

p.intro

Selects all

elements with class="intro"

8
New cards

div, p

Selects all

elements and all

elements

9
New cards

div p

Selects all

elements inside

elements

10
New cards

div > p

Selects all

elements where the parent is a

element

11
New cards

div + p

Selects the first

element that is placed immediately after

elements

12
New cards

p ~ ul

Selects every

    element that is preceded by a

    element

13
New cards

[target]

Selects all elements with a target attribute

14
New cards

[target="_blank"]

Selects all elements with target="_blank"

15
New cards

[title~="flower"]

Selects all elements with a title attribute containing the word "flower"

16
New cards

[lang|="en"]

Selects all elements with a lang attribute value equal to "en" or starting with "en-"

17
New cards
18
New cards
20
New cards

a:active

Selects the active link

21
New cards

p::after

Insert something after the content of each

element

22
New cards

p::before

Insert something before the content of each

element

23
New cards

input:checked

Selects every checked element

24
New cards

input:default

Selects the default element

25
New cards

input:disabled

Selects every disabled element

26
New cards

p:empty

Selects every

element that has no children (including text nodes)

27
New cards

input:enabled

Selects every enabled element

28
New cards

p:first-child

Selects every

element that is the first child of its parent

29
New cards

p::first-letter

Selects the first letter of every

element

30
New cards

p::first-line

Selects the first line of every

element

31
New cards

p:first-of-type

Selects every

element that is the first

element of its parent

32
New cards

input:focus

Selects the input element which has focus

33
New cards

:fullscreen

Selects the element that is in full-screen mode

34
New cards

a:hover

Selects links on mouse over

35
New cards

input:in-range

Selects input elements with a value within a specified range

36
New cards

input:indeterminate

Selects input elements that are in an indeterminate state

37
New cards

input:invalid

Selects all input elements with an invalid value

38
New cards

p:lang(it)

Selects every

element with a lang attribute equal to "it" (Italian)

39
New cards

p:last-child

Selects every

element that is the last child of its parent

40
New cards

p:last-of-type

Selects every

element that is the last

element of its parent

41
New cards

a:link

Selects all unvisited links

42
New cards

::marker

Selects the markers of list items

43
New cards

:not(p)

Selects every element that is not a

element

44
New cards

p:nth-child(2)

Selects every

element that is the second child of its parent

45
New cards

p:nth-last-child(2)

Selects every

element that is the second child of its parent, counting from the last child

46
New cards

p:nth-last-of-type(2)

Selects every

element that is the second

element of its parent, counting from the last child

47
New cards

p:nth-of-type(2)

Selects every

element that is the second

element of its parent

48
New cards

p:only-of-type

Selects every

element that is the only

element of its parent

49
New cards

p:only-child

Selects every

element that is the only child of its parent

50
New cards

input:optional

Selects input elements with no "required" attribute

51
New cards

input:out-of-range

Selects input elements with a value outside a specified range

52
New cards

input::placeholder

Selects input elements with the "placeholder" attribute specified

53
New cards

input:read-only

Selects input elements with the "readonly" attribute specified

54
New cards

input:read-write

Selects input elements with the "readonly" attribute NOT specified

55
New cards

input:required

Selects input elements with the "required" attribute specified

56
New cards

:root

Selects the document's root element

57
New cards

::selection

Selects the portion of an element that is selected by a user

58
New cards

#news:target

Selects the current active #news element (clicked on a URL containing that anchor name)

59
New cards

input:valid

Selects all input elements with a valid value

60
New cards

a:visited

Selects all visited links