HTML Worksheet: Practice Test
Code tip (Read the code like a browser): Find the topic of the question: tags, headings, lists, links, images, structure or comments. Read the code line by line, the way a browser would. Count carefully: tags opened and closed, items, lines, paragraphs.
NameDateTime takenScore ___ / 40
- 1.Which of these is an opening tag? (a) </p> (b) </li> (c) <li> (d) </b>
-
2.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>I love mangoes.</p>
<p>My pets</p>
<p>Good morning!</p> -
3.💬 How many paragraphs show on the page?
<!-- <p>I love mangoes.</p> -->
<p>Cricket is fun.</p>
<p>Hello, world!</p> - 4.🏷️ What does a closing tag have that an opening tag does not? (a) a slash / (b) a dot . (c) a dollar $ (d) a hash #
- 5.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) width (c) height (d) alt
- 6.🔠 Which heading shows the BIGGEST text: <h2>, <h1>, <h3> or <h4>? (a) <h4> (b) <h3> (c) <h2> (d) <h1>
- 7.📋 Which list tag lists things in any order? (a) <ol> (b) <li> (c) <ul>
-
8.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Here is my best one.</p>
</body>
</html> (a) Here is my best one. (b) Easy snacks (c) body (d) Space Facts - 9.True or false: in <img>, src names the picture file. (a) True (b) False
- 10.Which of these is true of a web browser? (a) saves our .html files (b) sends pages over the net (c) opens web pages for us (d) hosts websites online
- 11.🏷️ Is <li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 12.Which of these is an empty tag? (a) <ul> (b) <h1> (c) <li> (d) <meta>
- 13.🔗 Which attribute holds the address of a link? (a) href (b) src (c) alt (d) id
- 14.True or false: <ol> is an unordered list. (a) False (b) True
-
15.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Riya’s Recipes</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Try this poha.</p>
</body>
</html> (a) Easy snacks (b) Try this poha. (c) Riya’s Recipes (d) index.html - 16.📄 Can HTML on its own pick a random number? (a) No (b) Yes
- 17.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <a href="about.html"> (c) <link about.html> (d) <a alt="about.html">
- 18.🔠 Which heading shows the SMALLEST text: <h4>, <h5>, <h6> or <h3>? (a) <h5> (b) <h3> (c) <h4> (d) <h6>
- 19.True or false: HTML on its own cannot pick a random number. (a) False (b) True
- 20.True or false: <b> is an empty tag. (a) True (b) False
- 21.🌐 Which one answers page requests? (a) a web browser (b) a code editor (c) a web server
-
22.💬 Which text will NOT show on the page?
<p>My best friend</p>
<!-- <p>Cricket is fun.</p> -->
<p>Good morning!</p>
<p>Hello, world!</p> (a) Cricket is fun. (b) Hello, world! (c) My best friend (d) Good morning! -
23.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="100"> (a) tiger.jpg (b) kite.png (c) A tiger asleep (d) map.png - 24.📄 Where does <title> go: in the head or in the body? (a) in the head (b) in the body
- 25.True or false: <link rel="stylesheet"> goes in the body. (a) True (b) False
-
26.🖼️ How many pixels wide is the picture drawn?
<img src="cake.jpg" alt="Birthday cake" width="400"> - 27.💬 How does an HTML comment start? (a) // (b) <!-- (c) # (d) /*
- 28.📋 Which list tag is an ordered list? (a) <li> (b) <ol> (c) <ul>
-
29.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="350"> - 30.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 31.🔠 Which heading shows the SMALLEST text: <h6>, <h5>, <h3> or <h2>? (a) <h5> (b) <h3> (c) <h6> (d) <h2>
- 32.📄 What is the first line of an HTML5 page? (a) <head> (b) <html> (c) <!DOCTYPE html> (d) <body>
- 33.📋 Which tag goes around each item of a list? (a) <li> (b) <p> (c) <ol> (d) <ul>
-
34.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="250"> (a) A red kite (b) tiger.jpg (c) A tiger asleep (d) width - 35.📋 Which list tag goes inside ul or ol? (a) <ol> (b) <ul> (c) <li>
- 36.🔠 Which heading shows the BIGGEST text: <h6>, <h4>, <h5> or <h3>? (a) <h5> (b) <h3> (c) <h4> (d) <h6>
- 37.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 38.True or false: a web server opens web pages for us. (a) True (b) False
- 39.Which of these is a closing tag? (a) <h1> (b) </title> (c) <li> (d) <b>
-
40.📋 How many items does this list show?
<ol>
<li>Grapes</li>
<li>Orange</li>
<li>Papaya</li>
</ol>
Answer key
- <li>
- 1
- 2
- a slash /
- alt
- <h1>
- <ul>
- Easy snacks
- True
- opens web pages for us
- an opening tag
- <meta>
- href
- False
- Riya’s Recipes
- No
- <a href="about.html">
- <h6>
- True
- False
- a web server
- Cricket is fun.
- tiger.jpg
- in the head
- False
- 400
- <!--
- <ol>
- 350
- an opening tag
- <h6>
- <!DOCTYPE html>
- <li>
- A tiger asleep
- <li>
- <h3>
- an opening tag
- False
- </title>
- 3
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids