Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML & CSS

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

What does HTML stand for?

a)

HyperText Markup Language

b)

Hyperlinks and Text Markup Language

c)

Home Tool Markup Language

d)

Hyperlinking Text Markup League

2.

Which tag is used to create a hyperlink?

a)

<img>

b)

<a>

c)

<link>

d)

<href>

3.

Which attribute is used to give an image alternative text?

a)

title

b)

src

c)

alt

d)

desc

4.

Where do you place the CSS file link in an HTML document?

a)

Inside <body>

b)

Inside <head>

c)

After </html>

d)

Inside a <div>

5.

Which CSS property changes the text color?

a)

background-color

b)

font-weight

c)

color

d)

text-style

6.

Which HTML element is semantic for main navigation links?

a)

<nav>

b)

<div class="nav">

c)

<menu>

d)

<section>

7.

How do you select an element with id="header" in CSS?

a)

.header

b)

#header

c)

header

d)

*header

8.

Which CSS property controls the spacing between the border and content?

a)

margin

b)

padding

c)

border-spacing

d)

gap

9.

What is the default display value of a <div> element?

a)

inline

b)

block

c)

flex

d)

inline-block

10.

Which tag sets the HTML document's character encoding?

a)

<meta name="viewport">

b)

<meta charset="UTF-8">

c)

<link charset="UTF-8">

d)

<script charset="UTF-8">

11.

The <section> element should always be used instead of <div>.

a)

True

b)

False

12.

Which CSS rule has higher specificity?

a)

.menu

b)

#menu

c)

div.menu

d)

p

13.

How do you write a CSS comment?

a)

//comment

b)

<!--comment-->

c)

/*coment*/

d)

*/comment /*

14.

Which property makes an element positioned relative to the viewport (stays when scrolling)?

a)

position:absolute;

b)

position:relative;

c)

position:fixed;

d)

position:static;

15.

Which HTML element is used to include JavaScript?

a)

<script>

b)

<javascript>

c)

<js>

d)

<code>

16.

(Multi-select — choose TWO) Which units are relative CSS units?

a)

px

b)

em

c)

%

d)

cm

17.

What does the CSS box-sizing: border-box; do?

a)

Adds extra border around the box

b)

Includes padding and border in the element's total width and height

c)

Removes margins from the element

d)

Hides the border

18.

Which meta tag is essential for responsive design on mobile devices?

a)

<meta charset="utf-8">

b)

<meta name="viewport" content="width=device-width, initial-scale=1.0">

c)

<meta name="responsive" content="true">

d)

<meta name="mobile" content="yes">

19.

Which CSS pseudo-class applies when the mouse is over a link?

a)

:active

b)

:visited

c)

:hover

d)

:focus

20.

In HTML, the tag used to create a numbered list is < (a)   >