Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSS Pseudo-classes Quiz

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

What is a pseudo-class used for?

a)

To add comments in CSS

b)

To style images only

c)

To create a new HTML element

d)

To define a special state of an element

2.

Which pseudo-class styles an element when a user moves the mouse over it?

a)

:focus

b)

:hover

c)

:active

d)

:visited

3.

Which pseudo-class is used to style visited links?

a)

:link

b)

:active

c)

:hover

d)

:visited

4.

What is the correct syntax for a pseudo-class?

a)

selector:pseudo-class: { property: value; }

b)

selector:pseudo-class { property: value; }

c)

selector:pseudo-class: property: value;

d)

selector:pseudo-class { value: property; }

5.

What does the :first-child pseudo-class match?

a)

The first child of an element

b)

The last child of an element

c)

All children of an element

d)

No children of an element

6.

Which of the following is a valid use of the :hover pseudo-class?

a)

a:hover.highlight { color: #ff0000; }

b)

a.highlight:hover { color: #ff0000; }

c)

a:hover { highlight: #ff0000; }

d)

a:hover { color: #highlight; }

7.

What happens when you hover over a link with the :hover pseudo-class?

a)

The link becomes bold

b)

The link gets underlined

c)

The link disappears

d)

The link changes color

8.

What is the purpose of the :lang pseudo-class?

a)

To define styles for different languages

b)

To remove styles from elements

c)

To create new languages

d)

To style links only

9.

Which of the following is NOT a pseudo-class?

a)

:focus

b)

:style

c)

:link

d)

:hover

10.

What does the :active pseudo-class represent?

a)

An element that is being clicked

b)

An element that is not clicked

c)

An element that is hovered over

d)

An element that is focused

11.

Which property is used to change the background color of an element on hover?

a)

color

b)

text-color

c)

background-color

d)

border-color