wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Mastering CSS Concepts

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the purpose of CSS selectors?

a)

The purpose of CSS selectors is to select HTML elements for styling.

b)

To define the structure of HTML documents.

c)

To manage server-side data processing.

d)

To create JavaScript functions for interactivity.

2.

Which selector targets all elements of a specific type?

a)

Class selector

b)

Universal selector

c)

Type selector

d)

ID selector

3.

How do you select an element with a specific class in CSS?

a)

*example

b)

#example

c)

.className

d)

.example

4.

What is the difference between an ID selector and a class selector?

a)

An ID selector can be used for multiple elements, while a class selector is for a single element.

b)

An ID selector targets a unique element with a specific 'id', while a class selector targets multiple elements with a shared 'class'.

c)

Both ID and class selectors target unique elements but are used differently in CSS.

d)

An ID selector is defined with a dot, while a class selector is defined with a hash.

5.

How do you create a grid container in CSS?

a)

Add 'grid-area' to the child elements.

b)

Use 'grid-template-columns' to define the grid.

c)

Set 'display: flex;' on the container element.

d)

Set 'display: grid;' on the container element.

6.

What property is used to define the number of columns in a CSS grid?

a)

grid-template-rows

b)

grid-template-columns

c)

grid-area

d)

grid-columns

7.

How do you make a grid item span multiple columns?

a)

Set the 'column-span' property in HTML.

b)

Use the 'grid-column' property in CSS.

c)

Use the 'grid-row' property in CSS.

d)

Apply 'flexbox' to the grid item.

8.

What is the purpose of the 'grid-template-areas' property?

a)

To define the number of columns in a grid layout.

b)

To create responsive images in CSS.

c)

To define named grid areas for layout in CSS Grid.

d)

To set the background color of a grid item.

9.

How can you create a simple fade-in animation using CSS?

a)

Use the following CSS: @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .element { animation: fadeIn 2s; }

b)

@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

c)

.element { animation: bounce 2s; }

d)

Use the following CSS: .element { transition: opacity 2s; opacity: 1; }

10.

What property is used to define the duration of a CSS animation?

a)

animation-time

b)

animation-length

c)

animation-speed

d)

animation-duration

11.

How do you define a CSS variable?

a)

A CSS variable is created by using 'set --variable-name value;' syntax.

b)

CSS variables are declared using 'var(--variable-name: value);'.

c)

A CSS variable is defined with 'variable-name: value;' without the '--'.

d)

A CSS variable is defined using the syntax '--variable-name: value;'. It can be accessed with 'var(--variable-name)'.

12.

What is the syntax to use a CSS variable in a style rule?

a)

--variable-name var()

b)

var(--variable-name)

c)

var[]

d)

variable-name: var()

13.

How can you change the value of a CSS variable dynamically?

a)

Use CSS preprocessors like SASS to modify variables.

b)

Set the variable in a separate JavaScript file without using 'style.setProperty'.

c)

Change the CSS variable in the HTML file directly.

d)

Use JavaScript to change the CSS variable with 'style.setProperty'.

14.

What is the difference between 'ease', 'linear', and 'ease-in-out' in CSS animations?

a)

'ease' is abrupt, 'linear' is variable, and 'ease-in-out' is unpredictable.

b)

'ease' and 'ease-in-out' are the same, while 'linear' is different.

c)

The difference is in the timing function: 'ease' is gradual, 'linear' is constant, and 'ease-in-out' combines both.

d)

'ease' is constant, 'linear' is gradual, and 'ease-in-out' is random.

15.

How do you apply multiple animations to a single element in CSS?

a)

Set animations in a separate CSS file.

b)

Use the 'animation' property with multiple animations separated by commas.

c)

Use the 'transform' property for animations.

d)

Apply animations using JavaScript only.