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.🔠 How many headings are in this code?
<h1>My pets</h1>
<p>I love mangoes.</p>
<h3>The red kite</h3>
<h3>Cricket is fun.</h3> - 2.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to colour it (c) to load it faster (d) to make it bigger
- 3.🏷️ What does a closing tag have that an opening tag does not? (a) a dot . (b) a dollar $ (c) a hash # (d) a slash /
-
4.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Match report</h1>
<p>We won by 5 runs.</p>
</body>
</html> (a) Match report (b) Art Gallery (c) We won by 5 runs. (d) body -
5.🔍 Which line is missing its closing tag?
line 1: <small>My pets</small>
line 2: <p>Hello, world!</p>
line 3: <h1>Good morning! (a) line 1 (b) line 3 (c) line 2 -
6.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<h2>My best friend</h2>
<p>Hello, world!</p>
<p>The red kite</p> - 7.🔗 Which attribute holds the address of a link? (a) id (b) href (c) alt (d) src
- 8.True or false: a code editor opens web pages for us. (a) True (b) False
- 9.Which of these has a closing tag? (a) <input> (b) <meta> (c) <br> (d) <title>
- 10.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
- 11.Which of these goes in the body? (a) <title> (b) <meta charset="utf-8"> (c) <ul> (d) <style>
-
12.🖼️ How many pixels wide is the picture drawn?
<img src="kite.png" alt="A red kite" width="350"> - 13.🔠 Which heading shows the BIGGEST text: <h3>, <h1>, <h4> or <h2>? (a) <h2> (b) <h1> (c) <h4> (d) <h3>
- 14.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) height (c) src (d) width
- 15.Which of these is true of a code editor? (a) opens web pages for us (b) turns HTML into a page (c) saves our .html files (d) hosts websites online
-
16.📋 What number does the browser show next to “Papaya”?
<ol>
<li>Guava</li>
<li>Mango</li>
<li>Papaya</li>
</ol> - 17.🖼️ Which attribute of <img> tells which image to load? (a) height (b) src (c) alt (d) width
- 18.💬 Does the browser show comments on the page? (a) No (b) Yes
- 19.Which of these is true of a web browser? (a) has an address bar (b) shows line numbers (c) sends pages over the net (d) stores a website’s files
- 20.💬 How does an HTML comment start? (a) /* (b) // (c) # (d) <!--
-
21.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="fort.jpg" alt="An old fort" width="150"> (a) An old fort (b) A tiger asleep (c) width (d) fort.jpg -
22.🔗 Which address opens when you click this link?
<a href="news.html">Contact us</a> (a) news.html (b) games.html (c) Contact us (d) quiz.html - 23.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h2> or <h3>? (a) <h2> (b) <h1> (c) <h6> (d) <h3>
- 24.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) makes it blank (d) hides the link
- 25.🔗 Which code links to about.html? (a) <link about.html> (b) <a alt="about.html"> (c) <a src="about.html"> (d) <a href="about.html">
-
26.🔍 Which line is missing its closing tag?
line 1: <h2>The red kite</h2>
line 2: <h1>I love mangoes.</h1>
line 3: <p>My best friend (a) line 3 (b) line 1 (c) line 2 -
27.🔗 Which words do you click on?
<a href="https://example.com">Play games</a> (a) href (b) Play games (c) About us (d) https://example.com -
28.🔗 Where does this link open?
<a href="contact.html" target="_blank">Art corner</a> (a) in the same tab (b) in a new tab - 29.🔠 Which heading shows the SMALLEST text: <h4>, <h5>, <h3> or <h1>? (a) <h4> (b) <h1> (c) <h3> (d) <h5>
- 30.🖼️ Which tag puts a picture on a page? (a) <p> (b) <a> (c) <pic> (d) <img>
- 31.Which of these is true of a code editor? (a) stores a website’s files (b) shows line numbers (c) answers page requests (d) opens web pages for us
-
32.🔗 Which address opens when you click this link?
<a href="https://example.com">Take the quiz</a> (a) art.html (b) https://example.com (c) maths.html (d) Take the quiz - 33.🔢 In a basic web page file, which comes first: “<html>” or “</html>”? (a) </html> (b) <html>
- 34.True or false: <b> has a closing tag. (a) False (b) True
- 35.Which of these is true of a code editor? (a) stores a website’s files (b) has an address bar (c) is where we type code (d) shows pages from the web
- 36.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 37.📝 Does <b> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 38.📝 What does <hr> draw? (a) a line across the page (b) a link (c) a picture (d) a table
-
39.🔗 Which words do you click on?
<a href="art.html">Art corner</a> (a) School news (b) href (c) art.html (d) Art corner - 40.📛 In <a href="x.html">, what is href? (a) an element name (b) a closing tag (c) an attribute (d) a comment
Answer key
- 3
- to describe the image
- a slash /
- Match report
- line 3
- 3
- href
- False
- <title>
- Yes
- <ul>
- 350
- <h1>
- alt
- saves our .html files
- 3
- src
- No
- has an address bar
- <!--
- An old fort
- news.html
- <h1>
- opens it in a new tab
- <a href="about.html">
- line 3
- Play games
- in a new tab
- <h5>
- <img>
- shows line numbers
- https://example.com
- <html>
- True
- is where we type code
- an opening tag
- has a closing tag
- a line across the page
- Art corner
- an attribute
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids