wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSS Fundamentals

Total questions: 14

Worksheet time: 7mins

Name
Class
Date
1.

What is the purpose of CSS selectors?

a)

CSS selectors are meant for organizing server-side scripts.

b)

CSS selectors are used to create HTML elements.

c)

The purpose of CSS selectors is to define JavaScript functions.

d)

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

2.

Which of the following is a type of CSS selector: class, ID, or both?

a)

element

b)

both

c)

attribute

d)

style

3.

What property is used to change the text color in CSS?

a)

text-color

b)

font-color

c)

background-color

d)

color

4.

What is the difference between inline and internal CSS?

a)

Inline CSS affects a single element, while internal CSS affects multiple elements in the document.

b)

Inline CSS is defined in a separate file, while internal CSS is written within the HTML tags.

c)

Inline CSS applies to all elements, while internal CSS targets only one element.

d)

Inline CSS is used for external styles, while internal CSS is for inline styles.

5.

Which CSS property controls the layout of a flex container?

a)

display

b)

align-items

c)

flex-wrap

d)

flex-direction

6.

How do you represent the color red in hexadecimal format?

a)

#0000FF

b)

#00FF00

c)

#FFFF00

d)

#FF0000

7.

What does the 'flex-direction' property do in a flex container?

a)

It aligns flex items to the center of the container.

b)

It specifies the spacing between flex items in a container.

c)

It determines the size of flex items in a flex container.

d)

It sets the direction of flex items in a flex container.

8.

Which CSS property is used to set the background color of an element?

a)

background-color

b)

background-style

c)

color-background

d)

element-color

9.

What is the syntax for a class selector in CSS?

a)

.classname

b)

classname:

c)

classname()

d)

#classname

10.

How can you center a flex item horizontally within a flex container?

a)

Use 'justify-content: center' on the flex container.

b)

Set 'align-items: center' on the flex container.

c)

Use 'margin: auto' on the flex item.

d)

Apply 'flex-direction: column' to the flex container.

11.

What is the purpose of the 'display' property in CSS?

a)

To specify the font style of elements in CSS.

b)

To control the layout and rendering of elements on a web page.

c)

To set the size of images displayed on a page.

d)

To define the color of text on a web page.

12.

What is the function of the 'margin' property in CSS?

a)

To specify the border style of elements.

b)

To control the visibility of elements.

c)

To define the font size of text.

d)

To set the space around elements.

13.

How do you apply a style to all paragraphs in a document using CSS?

a)

paragraph { }

b)

all p { }

c)

p: { }

d)

p { }

14.

What is the purpose of the 'padding' property in CSS?

a)

To set the space inside an element, between the element's content and its border.

b)

To define the space outside an element, between the element and its surrounding elements.

c)

To control the size of the element's border.

d)

To specify the font style of the text within an element.