wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSS Day-2

Total questions: 25

Worksheet time: 16mins

Name
Class
Date
1.

Which CSS property controls how an element is displayed?

a)

position

b)

float

c)

display

d)

visibility

2.

If you want a flex container to lay out its items vertically from bottom to top, which property and value should you use ?

a)

flex-direction: column;

b)

flex-direction: column-reverse;

c)

flex-wrap: wrap-reverse;

d)

justify-content: flex-end;

3.

Which positioning value removes an element from the normal document flow and positions it relative to its nearest positioned ancestor

a)

static

b)

relative

c)

fixed

d)

absolute

4.

Which property sets the main axis direction?

a)

flex-wrap

b)

justify-content

c)

flex-direction

d)

flex-direction

5.

What is the main purpose of the viewport meta tag in responsive design?

a)

To set the background color for mobile devices.

b)

To control the layout viewport and prevent mobile browsers from rendering at desktop widths.

c)

To enable the use of CSS Grid on mobile screens.

d)

To automatically resize all images to 100% width.

6.

flex-direction affects which axis?

a)

Cross axis

b)

Both axes

c)

Main axis

d)

Inline axis

7.

An element is styled with position: sticky; top: 0;. Which of the following best describes its behavior during scrolling?

a)

It remains permanently at the top of the viewport and ignores all other content.

b)

justify-contentIt acts like position: relative until its top edge reaches the top of the viewport, then it acts like position: fixed.

c)

It is removed from the normal document flow and stays 0px from the top of the nearest ancestor.

d)

It only becomes visible when the user scrolls to the top of the page.

8.

When flex-wrap: wrap, extra items move to the __________.

a)

previous line

b)

next line

c)

same line

d)

center

9.

What does justify-content control in Flexbox?

a)

Alignment on the cross axis

b)

Alignment on the main axis

c)

Text alignment

d)

Vertical centering only

10.

Consider a grid container defined with grid-template-columns: 1fr 2fr 1fr;. If the total width of the container is 800px and there is no gap, what is the width of the second column?

(a)  

11.

Which value centers items along the cross axis?

a)

center

b)

stretch

c)

flex-start

d)

flex-end

12.

align-items is applied on the __________.

a)

flex item

b)

child element

c)

flex container

d)

text node

13.

Which property makes an element a grid container?

a)

display: flex

b)

display: flex

c)

display: block

d)

position: grid

14.

CSS Grid is mainly used for (a)   -dimensional layouts.

15.

Which property is used to define grid rows?

a)

grid-rows

b)

grid-template-rows

c)

row-template

d)

grid-auto-rows

16.

The fr unit stands for (a)   unit.

17.

What is Responsive Web Design?

a)

Designing only for desktop

b)

Designing fixed-width layouts

c)

Designing layouts that adapt to different screen sizes

d)

Designing mobile apps

18.

Which CSS feature is mainly used to create responsive layouts?

(a)  

19.

max-width: 100% prevents images from (a)   their container.

20.

Where is the viewport meta tag placed?

a)

body

b)

footer

c)

head

d)

header

21.

Which is the correct syntax for the viewport meta tag?

a)

<meta viewport="width=device-width">

b)

<meta name="viewport" content="width=device-width, initial-scale=1.0">

c)

<viewport meta="device-width">

d)

<meta device-width="true">

22.

Responsive design depends on viewport and (a)   queries.

23.

1vw is equal to:

a)

1% of parent width

b)

1% of parent width

c)

1px

d)

10% of viewport

24.

Which unit is relative to the root (html) font size?

a)

em

b)

%

c)

rem

d)

vw

25.

Percentage (%) units are relative to the (a)   element.