wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSS Selectors

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.

Which of the following selectors selects any tag with an id attribute set?

a)

E#id

b)

.class

c)

#id

d)

*

2.

What will be the output of below mentioned code snippet?

p strong {background-color: yellow;}

a)

Strong have yellow background

b)

Strong element within a p element have a yellow background

c)

Both p and strong have yellow background

d)

None of the mentioned

3.

The _____________ attribute is used to define the name(s) of the class(es) to which a particular tag belongs.

a)

class

b)

elelment

c)

id

d)

none of the choices

4.

By applying an ___________ a style can be applied to just a single tag.

a)

class rule

b)

element rule

c)

id rule

d)

none of the choices

5.

What type of selector is used in this case?

p {line-height: 150%;}

a)

class selector

b)

element selector

c)

id selector

d)

none of the choices

6.

How many different types of selectors in CSS?

a)

3

b)

4

c)

5

d)

6

7.

An id is NOT always unique within the page so it is chosen to select a single, unique element.

a)

True

b)

False

8.

The universal selector is used as a ?

a)

Wildcard Character

b)

Page Character

c)

Commas character

d)

None of the above

9.

___________ are used to separate each selector in grouping.

a)

#

b)

.

c)

;

d)

,

10.

A ___________ is used to define a special state of an element.

a)

pseudo-tag

b)

pseudo-element

c)

pseudo-id

d)

pseudo-class