wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

HTML and CSS Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the purpose of the <p> tag in HTML?

a)

is used to define images

b)

is used to define paragraphs

c)

is used to define headings

d)

is used to define lists

2.

What does the color property in CSS specify?

a)

color property is used to set the background color of an element

b)

color property is used to set the text color of an element

c)

color property is used to set the border color of an element

d)

color property is used to set the size of an element

3.

What is the purpose of <h1> to <h6> tags in HTML?

a)

to are used for creating hyperlinks

b)

to are used for creating lists

c)

to are used for creating headings

d)

to are used for creating tables

4.

What does CSS stand for?

a)

CSS stands for Cascading Style System

b)

CSS stands for Cascading Style Sheets

c)

CSS stands for Computer Style Sheets

d)

CSS stands for Creative Style Syntax

5.

What does the margin property in CSS define?

a)

margin defines the space inside an element

b)

margin defines the space outside an element

c)

margin is used to set the border of an element

d)

margin is used to set the font style of an element

6.

What is the purpose of the <div> tag in HTML?

a)

The tag is used to create hyperlinks

b)

The tag is used to group block-level elements

c)

The tag is used to display inline elements

d)

The tag is used to define styles

7.

Where is inline CSS written?

a)

Inline CSS is written inside tags

b)

Inline CSS is written inside the section

c)

Inline CSS is written directly in the HTML tag

d)

Inline CSS is written in a separate file

8.

What does the padding property in CSS adjust?

a)

The padding property adjusts the space between elements

b)

The padding property adjusts the space inside an element

c)

The padding property adjusts the space outside an element

d)

The padding property adjusts the size of text

9.

What is the purpose of the <a> tag in HTML?

a)

The tag is used to create images

b)

The tag is used to create tables

c)

The tag is used to create hyperlinks

d)

The tag is used to create lists

10.

How is the id selector defined in CSS?

a)

The id selector is defined using a period (.)

b)

The id selector is defined using a hashtag (#)

c)

The id selector is defined using a slash (/)

d)

The id selector is defined using an asterisk (*)

11.

What is the purpose of the <ul> tag in HTML?

a)

The tag creates an ordered list

b)

The tag creates an unordered list

c)

The tag creates a description list

d)

The tag creates a table

12.

What is the default position of an HTML element?

a)

absolute

b)

relative

c)

static

d)

fixed

13.

Which attributes are required for the<img> tag?

a)

src only

b)

Both src and alt

c)

href only

d)

name only

14.

What is the purpose of the z-index property in CSS?

a)

To set text color

b)

To stack elements

c)

To define font size

d)

To define padding

15.

What does the <br> tag do in HTML?

a)

Creates a horizontal line

b)

Creates a line break

c)

Creates bold text

d)

Creates a blockquote

16.

Where is external CSS written?

a)

Inside the HTML file

b)

In a separate .css file

c)

Inside tags

d)

Directly in the HTML tag

17.

What type of border does border: 1px solid red; create?

a)

A dashed red border

b)

A solid red border

c)

A dotted red border

d)

A double red border

18.

What is the purpose of the <link> tag in HTML?

a)

To link JavaScript files

b)

To link CSS files

c)

To link images

d)

To link audio files

19.

What does the <title> tag define?

a)

The main heading of the page

b)

The title shown in the browser tab

c)

The content of the page

d)

The metadata of the page

20.

What does the font-size property in CSS define?

a)

The font family

b)

The text size

c)

The text alignment

d)

The text decoration