wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML and CSS Basics Quiz

Total questions: 27

Worksheet time: 14mins

Name
Class
Date
1.

What does the 'doctype HTML' tag indicate in an HTML document?

a)

It sets the background color of the web page

b)

It specifies the character set of the document

c)

It indicates the start of the HTML document

d)

It defines the title of the web page

2.

What is the purpose of the 'head' tag in HTML?

a)

It contains the main content of the web page

b)

It references external resources for the web page

c)

It creates a link to another web page

d)

It defines the styling and layout of the web page

3.

Which tag is used for writing full sentences and paragraphs in HTML?

a)

H2

b)

P

c)

A

d)

H1

4.

What does the 'H1' tag represent in HTML?

a)

A medium-sized heading

b)

A subheading

c)

The largest heading

d)

The smallest heading

5.

What is the purpose of the 'utf-8' character set in HTML?

a)

It sets the text alignment of the web page

b)

It defines the font style for the web page

c)

It specifies the character encoding for the web page

d)

It specifies the language of the web page

6.

What is the default behavior of the 'title' tag in HTML?

a)

It displays the title of the web page in the browser tab

b)

It creates a pop-up message when the mouse hovers over an element

c)

It sets the title of the web page as the header

d)

It defines the title of a section within the web page

7.

What is the purpose of the 'body' tag in HTML?

a)

It contains the main content of the web page

b)

It creates a link to another web page

c)

It defines the styling and layout of the web page

d)

It references external resources for the web page

8.

What is the significance of the 'H2' tag in HTML?

a)

It indicates a subheading within a section

b)

It represents the smallest heading

c)

It sets the font style for the web page

d)

It defines the largest heading

9.

How can heading tags be reused in HTML?

a)

They can be used for creating hyperlinks

b)

They are not reusable in HTML

c)

They can be used multiple times in a document

d)

They can only be used once in a document

10.

What does the 'img' tag do in HTML?

a)

It creates a hyperlink

b)

It embeds an image

c)

It defines a section

d)

It creates a table

11.

What CSS property is used to center an image?

a)

align

b)

display

c)

margin

d)

position

12.

What CSS property is used to center an image?

a)

align

b)

display

c)

margin

d)

position

13.

Which CSS property is used to add a line around an image?

a)

edge

b)

outline

c)

frame

d)

border

14.

What does the 'border-radius' property do in CSS?

a)

Changes the color of the border

b)

Adds a shadow to the border

c)

Rounds the corners of the border

d)

Increases the thickness of the border

15.

What value is used to center an image horizontally in CSS?

a)

0 auto

b)

auto 0

c)

center

d)

50%

16.

Which CSS property is used to specify the type of border?

a)

type

b)

format

c)

pattern

d)

style

17.

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

a)

To change the font size

b)

To add padding to an element

c)

To change the text color

d)

To control the layout of an element

18.

Which tag is used for the content of the web page in the CSS file?

a)

DIV

b)

SPAN

c)

HTML

d)

BODY

19.

What attribute is used to change the color of the font in CSS?

a)

Color

b)

Font

c)

Text-Color

d)

Font-Color

20.

How is the font size specified in CSS?

a)

Text-Size

b)

Font

c)

Font-Size

d)

Size

21.

What property is used to align text in the center in CSS?

a)

Align-Text

b)

Text-Center

c)

Text-Align

d)

Center-Text

22.

Which property is used to change the background color of the web page in CSS?

a)

Background-Color

b)

Page-Color

c)

Background

d)

Color-Background

23.

What is the purpose of adding padding to a tag in CSS?

a)

Increase font size

b)

Add space inside the box

c)

Change font color

d)

Align text

24.

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

a)

To create a boundary around an element

b)

To change the font color

c)

To increase the font size

d)

To align the text

25.

What is the correct tag for adding an image in HTML?

a)

URL

b)

SRC

c)

HTML

d)

IMG

26.

Why is it better to save the image file with a short and descriptive name?

a)

To increase website speed

b)

To save storage space

c)

To confuse the user

d)

To easily identify the image

27.

What is the potential issue with referencing an image through a URL in HTML?

a)

It makes the image unstable

b)

It increases website security

c)

It reduces image loading time

d)

It improves website performance