wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Box Model Quiz

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Which component of the CSS Box Model is the transparent space inside the border, separating the border from the element's actual content?

a)

Margin

b)

Padding

c)

Box-Sizing

d)

Content

2.

In the standard CSS Box Model flow, which component is the outermost layer that creates space between the element and its neighboring elements?

a)

Outline

b)

Border

c)

Margin

d)

Padding

3.

Which of the following correctly sets a thickness of 3 pixels around a paragraph element?

a)

border-weight: 3px;

b)

border-width: 3px;

c)

border: 3px;

d)

border-thickness: 3px;

4.

If you set padding: 10px 20px;, what does 20px represent?

a)

Padding for all sides

b)

Padding for top and bottom

c)

Padding for left and right

d)

Padding for bottom only

5.

Which code snippet will create 30px of space between two <div> elements?

a)

div { border: 30px; }

b)

div { padding: 30px; }

c)

div { spacing: 30px; }

d)

div { margin: 30px; }

6.

Given the following CSS:
What is the total extra space (in pixels) added horizontally to the content (excluding the content width)?

a)

64px

b)

22px

c)

44px

d)

84px

7.

Which of the following correctly removes the top margin of a <p> element but keeps the other sides at 10px?

a)

margin: 0 10px 10px 10px;

b)

margin: 10px 10px 10px 0;

c)

margin: 10px 0 10px 10px;

d)

margin-top: none;

8.

What will be the result of the following CSS?

a)

All sides have the same border width and color.

b)

Each side has a different width but the same color.

c)

Each side has a different width and color

d)

The code will produce an error.

9.

You want to add 10px of padding to the top and bottom, and 0px to the left and right. Which shorthand is correct?

a)

padding: 10px;

b)

padding: 10px 0;

c)

padding: 0 10px;

d)

padding: 10px 0px 10px 0px;

10.

Which statement best describes the difference between margin and padding in the CSS box model?

a)

Margin is inside the border; padding is outside.

b)

Padding is between the content and the border; margin is outside the border.

c)

Margin and padding have the same effect on layout.

d)

Padding affects only text, not elements.