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 a closing tag? (a) <body> (b) <p> (c) </p> (d) <li>
-
2.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>My best friend</p>
<p>My best friend</p> -
3.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<p>Our school trip</p>
<p>Fun facts</p>
<p>I love mangoes.</p>
<p>Fun facts</p> - 4.🔗 Which code links to about.html? (a) <a alt="about.html"> (b) <a href="about.html"> (c) <link about.html> (d) <a src="about.html">
- 5.Which of these is true of a code editor? (a) turns HTML into a page (b) sends pages over the net (c) is where we type code (d) opens web pages for us
- 6.💬 Why do coders write comments? (a) to show pictures (b) to leave notes (c) to add colour (d) to make links
-
7.💬 How many paragraphs show on the page?
<!-- <p>My best friend</p> -->
<!-- <p>Rain today</p> -->
<p>Fun facts</p>
<!-- <p>My pets</p> --> -
8.🔗 Which words do you click on?
<a href="art.html">Contact us</a> (a) art.html (b) Visit the site (c) Contact us (d) href - 9.📋 Which list tag goes inside ul or ol? (a) <li> (b) <ul> (c) <ol>
- 10.Which of these goes in the head? (a) <table> (b) <img> (c) <link rel="stylesheet"> (d) <a>
- 11.🌐 Which one saves our .html files? (a) a web server (b) a web browser (c) a code editor
- 12.True or false: in <img>, alt names the picture file. (a) True (b) False
- 13.Which of these is an opening tag? (a) <h1> (b) </body> (c) </li> (d) </b>
- 14.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
- 15.🏷️ Which is the closing tag for <em>? (a) <\em> (b) <em/> (c) <em> (d) </em>
- 16.🔠 Which heading shows the SMALLEST text: <h1>, <h5>, <h6> or <h2>? (a) <h6> (b) <h5> (c) <h2> (d) <h1>
- 17.🔠 Which heading shows the SMALLEST text: <h5>, <h1>, <h2> or <h3>? (a) <h3> (b) <h5> (c) <h2> (d) <h1>
- 18.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to describe the image (d) to colour it
- 19.🖼️ Which attribute of <img> is read by screen readers? (a) alt (b) src (c) width (d) height
- 20.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <h1> (c) <p> (d) <br>
- 21.🔤 In “HTML”, what does the L stand for? (a) Line (b) Laptop (c) Language (d) Link
- 22.🏷️ Is <title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 23.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
-
24.💬 How many paragraphs show on the page?
<p>The red kite</p>
<p>Good morning!</p>
<!-- <p>Cricket is fun.</p> --> - 25.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as one space (d) as a dot
- 26.True or false: <style> goes in the body. (a) True (b) False
- 27.🔗 Which attribute holds the address of a link? (a) href (b) src (c) id (d) alt
- 28.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h4>? (a) <h4> (b) <h2> (c) <h6> (d) <h1>
-
29.🖼️ How many pixels wide is the picture drawn?
<img src="bus.jpg" alt="Our school bus" width="50"> - 30.🖼️ Which attribute of <img> tells which image to load? (a) src (b) height (c) alt (d) width
- 31.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
-
32.🔠 How many headings are in this code?
<h1>Good morning!</h1>
<h2>My pets</h2>
<p>Our school trip</p>
<h3>My pets</h3> -
33.💬 Which text will NOT show on the page?
<p>My pets</p>
<!-- <p>Cricket is fun.</p> -->
<p>Rain today</p> (a) Cricket is fun. (b) My pets (c) Rain today - 34.🔠 Which heading shows the SMALLEST text: <h3>, <h6>, <h2> or <h5>? (a) <h5> (b) <h3> (c) <h6> (d) <h2>
- 35.🏷️ Is </body> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 36.📝 Does <input> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
-
37.💬 How many paragraphs show on the page?
<p>Good morning!</p>
<p>Hello, world!</p>
<!-- <p>Rain today</p> -->
<!-- <p>Fun facts</p> -->
<!-- <p>Cricket is fun.</p> --> - 38.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <title> (c) <ul> (d) <style>
-
39.🔠 How many headings are in this code?
<h1>I love mangoes.</h1>
<h4>My pets</h4>
<h2>Rain today</h2>
<p>Fun facts</p>
<h4>Cricket is fun.</h4> - 40.Which of these is a closing tag? (a) </h1> (b) <h1> (c) <p> (d) <b>
Answer key
- </p>
- 1
- 5
- <a href="about.html">
- is where we type code
- to leave notes
- 1
- Contact us
- <li>
- <link rel="stylesheet">
- a code editor
- False
- <h1>
- <a>
- </em>
- <h6>
- <h5>
- to describe the image
- alt
- <h1>
- Language
- an opening tag
- a code editor
- 2
- as one space
- False
- href
- <h1>
- 50
- src
- <!--
- 3
- Cricket is fun.
- <h6>
- a closing tag
- an empty tag
- 2
- <ul>
- 4
- </h1>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids