Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSS Basics Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the main purpose of a Style Sheet (CSS)?

a)

To add images to a web page

b)

To design the appearance (look & feel) of a web page

c)

To store website data

d)

To create links between pages

2.

Which statement best describes the relationship between HTML and CSS?

a)

HTML adds style; CSS adds structure

b)

CSS replaces HTML

c)

HTML creates structure; CSS makes it look attractive

d)

Both HTML and CSS perform the same task

3.

Which method of applying CSS is considered the best practice for large websites?

a)

Inline CSS

b)

Internal CSS

c)

External CSS

d)

Comment CSS

4.

What is the correct syntax for a CSS rule?

a)

selector: { value = property }

b)

selector { property: value; }

c)

{ selector value: property }

d)

(selector property: value)

5.

Which of the following is an example of an inline CSS style?

a)

<style> h1 { color: blue; } </style>

b)

<h1 style="color: blue;">My School</h1>

c)

h1 { color: blue; } (inside style.css)

d)

<link rel="stylesheet" href="style.css">

6.

How do you write a single-line CSS comment?

a)

// This is a comment

b)

<!-- This is a comment -->

c)

/* This is a comment */

d)

# This is a comment

7.

Which selector is used to apply style to a single unique element?

a)

Class selector

b)

Element selector

c)

Group selector

d)

ID selector

8.

What symbol is used to select a class in CSS?

a)

#

b)

.

c)

*

d)

:

9.

Which CSS selector will style ALL

tags in a web page?

a)

#p { }

b)

.p { }

c)

p { }

d)

*p { }

10.

Which of the following correctly groups multiple selectors?

a)

h1 + h2 + h3 { color: red; }

b)

h1 h2 h3 { color: red; }

c)

h1, h2, h3 { color: red; }

d)

h1:h2:h3 { color: red; }

11.

Which method places CSS inside the <head> section of an HTML file?

a)

Inline CSS

b)

External CSS

c)

Internal CSS

d)

Outline CSS

12.

Which of the following is the correct way to connect an external CSS file?

a)

<css src="style.css">

b)

<style href="style.css">

c)

<link rel="stylesheet" href="style.css">

d)

<script src="style.css">

13.

Which selector is used to select multiple elements to apply the same style?

a)

Group selector

b)

ID selector

c)

Universal selector

d)

Attribute selector

14.

What will the following CSS rule do?
h2 {

color: green;

}

a)

Changes the background of all <h2> elements

b)

Changes the text color of all <h2> elements

c)

Changes only the first <h2> element

d)

Creates a new <h2> element

15.

What is the purpose of writing comments in CSS?

a)

To hide CSS from the browser

b)

To explain code and improve readability

c)

To make the page load faster

d)

To create new selectors