wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML and CSS Quiz

Total questions: 35

Worksheet time: 18mins

Name
Class
Date
1.

Which tag is used to define the largest heading in HTML?

a)

<h1>

b)

<head>

c)

<title>

d)

<h6>

2.

Which attribute is used to provide an image source in HTML?

a)

src

b)

href

c)

link

d)

alt

3.

The correct HTML element to insert a line break is:

a)

<break>

b)

<br>

c)

<lb>

d)

<newline>

4.

Which tag is used to create a hyperlink?

a)

<a>

b)

<link>

c)

<href>

d)

<hyper>

5.

Which HTML element is used to display an unordered list?

a)

  • <ol>

b)

  1. <li>

c)

<ul>

d)

<list>

6.

Which tag is used to insert an image in HTML?

a)

<image>

b)

<img>

c)

<pic>

d)

<src>

7.

The correct way to make text bold in HTML is:

a)

<b>

b)

<bold>

c)

<strong>

d)

Both <b> and <strong>

8.

Which tag is used to display a numbered list?

a)

  1. <nl>

b)

  • <ul>

c)

<ol>

d)

<List>

9.

Which attribute specifies an alternate text for images?

a)

alt

b)

title

c)

text

d)

label

10.

HTML stands for:

a)

Hyper Text Makeup Language

b)

Hyper Transfer Markup Language

c)

Hyper Text Markup Language

d)

High Text Markup Language

11.

Which tag is used to create a table row?

a)

<row>

b)

<th>

c)

<td>

d)

<tr>

12.

The <title> tag is placed inside:

a)

<body>

b)

<head>

c)

<h1>

d)

<html>

13.

Which tag is used for inserting a horizontal line?

a)

<line>

b)

<h1>

c)

<br>

d)

<hr>

14.

Which tag is used to define a paragraph?

a)

<para>

b)

<paragraph>

c)

<p>

d)

<pg>

15.

Which tag defines the document’s main content?

a)

<body>

b)

<main>

c)

<content>

d)

<section>

16.

CSS stands for:

a)

Computer Style Sheets

b)

Cascading Style Sheets

c)

Colorful Style Sheets

d)

Creative Style Sheets

17.

Which property changes text color?

a)

bgcolor

b)

color

c)

text-color

d)

fontcolor

18.

Which property is used to change background color?

a)

bgcolor

b)

background-color

c)

bg-color

d)

color-bg

19.

How do you select all

elements in CSS?

a)

p { }

b)

#p { }

c)

.p { }

d)

*p { }

20.

Which property is used to change font size?

a)

font-size

b)

text-size

c)

size

d)

font

21.

Which CSS property controls text alignment?

a)

text-decoration

b)

text-align

c)

align

d)

position

22.

Which is the correct way to apply an external CSS file?

a)

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

b)

<css link="style.css">

c)

<style src="style.css">

d)

<stylesheet>style.css</stylesheet>

23.

Which property adds space inside an element’s border?

a)

margin

b)

padding

c)

border

d)

spacing

24.

Which property adds space outside an element’s border?

a)

padding

b)

margin

c)

spacing

d)

border

25.

Which is the correct syntax for a CSS comment?

a)
b)

// comment

c)

/* comment */

d)

# comment

26.

Which function is used to display output in Python?

a)

echo()

b)

display()

c)

print()

d)

output()

27.

Which symbol is used for comments in Python?

a)

//

b)
c)

#

d)

%

28.

What is the correct way to assign a variable?

a)

int x = 10

b)

x = 10

c)

var x = 10

d)

10 -> x

29.

Which data type is used for text in Python?

a)

int

b)

str

c)

float

d)

char

30.

What is the output of print(2**3)?

a)

5

b)

6

c)

8

d)

9

31.

Which function is used to get user input?

a)

scan()

b)

input()

c)

get()

d)

read()

32.

How do you write a list in Python?

a)

{1,2,3}

b)

(1,2,3)

c)

[1,2,3]

d)
33.

Which operator is used for division in Python?

a)

/

b)

\

c)

%

d)

//

34.

What is the output of print(10 % 3)?

a)

0

b)

1

c)

2

d)

3

35.

Which of these is a Boolean value in Python?

a)

Yes / No

b)

True / False

c)

0 / 1

d)

Right / Wrong