wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

IDs and Classes

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

The keyboard key to select the browser's address bar

a)

F1

b)

F6

c)

F12

d)

F8

2.

An element having the ID attribute of "green"

a)

cannot be used since "green" is not a valid ID name

b)

can be used only once in an HTML page

c)

can be used more than once in an HTML page

d)

will cause the element to have a background-color of green

3.

The CSS symbol for a class is

a)

a period

b)

an octathorpe

c)

#

d)

a comma

4.

The CSS symbol for an ID is

a)

:

b)

;

c)

.

d)

#

5.

To add a class of "green" to a div element

a)

<div id="green"></div>

b)

<div class="green"></div>

c)

<div></div class="green">

d)

<div>class="green"</div>

6.

To make a series of block-level elements display side-by-side instead of vertically

a)

display: block;

b)

display: inline-block;

c)

display: circle;

d)

display: wide;

7.

Placing CSS style rules in the HEAD section of an HTML page is called ___ style rules.

a)

Embedded

b)

Inline

c)

External

d)

Efficient

8.

Two classes are assigned to the same element

a)

<div class="class1 class2"></div>

b)

<div class="class1" "class2"><div>

c)

<div class="class1" id="class2"></div>

d)

<div class="class1 and class2"></div>

9.

One ID and one class are assigned to the same element

a)

<div id="abc" and class="xyz"></div>

b)

<div id="abc class=xyz"></div>

c)

<div id="abc" class="xyz"></div>

d)

<div id="abc xyz"></div>

10.

If you have more than one class to assign to element

a)

separate them with a blank space inside the quotation marks

b)

separate them with a comma inside the quotation marks

c)

separate them with a semicolon inside the quotation marks

d)

forget about it - it can't be done!