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.💬 Does the browser show comments on the page? (a) Yes (b) No
- 2.🖼️ Which attribute of <img> tells which image to load? (a) height (b) alt (c) width (d) src
- 3.📄 Can HTML on its own show paragraphs? (a) No (b) Yes
-
4.🖼️ How many pixels wide is the picture drawn?
<img src="tiger.jpg" alt="A tiger asleep" width="200"> - 5.📝 What does <hr> draw? (a) a picture (b) a link (c) a table (d) a line across the page
- 6.💾 A web page file usually ends with which extension? (a) .txt (b) .png (c) .mp3 (d) .html
- 7.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
- 8.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h1> or <h6>? (a) <h4> (b) <h1> (c) <h2> (d) <h6>
- 9.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <link about.html> (c) <a src="about.html"> (d) <a alt="about.html">
-
10.💬 Which text will NOT show on the page?
<p>I love mangoes.</p>
<!-- <p>My pets</p> -->
<p>Rain today</p>
<p>My best friend</p> (a) My best friend (b) I love mangoes. (c) Rain today (d) My pets - 11.🔢 In a basic web page file, which comes FIRST? (a) <body> (b) <html> (c) <!DOCTYPE html> (d) </body>
-
12.📝 How many paragraphs does this code make?
<p>My best friend</p>
<h2>The red kite</h2>
<p>Our school trip</p>
<h2>Rain today</h2> - 13.🔠 Which heading shows the SMALLEST text: <h3>, <h6>, <h1> or <h2>? (a) <h1> (b) <h2> (c) <h6> (d) <h3>
- 14.🔠 Which heading shows the BIGGEST text: <h2>, <h3>, <h1> or <h5>? (a) <h1> (b) <h2> (c) <h5> (d) <h3>
- 15.🏷️ Every HTML tag starts with which sign? (a) { (b) < (c) [ (d) (
-
16.🔗 Which address opens when you click this link?
<a href="games.html">Maths fun</a> (a) contact.html (b) about.html (c) Maths fun (d) games.html - 17.True or false: <li> goes inside ul or ol. (a) True (b) False
- 18.🔍 Which is the odd one out? (a) sends pages over the net (b) hosts websites online (c) answers page requests (d) opens web pages for us
-
19.🔍 Which line is missing its closing tag?
line 1: <h3>Good morning!
line 2: <em>I love mangoes.</em>
line 3: <small>Our school trip</small> (a) line 2 (b) line 3 (c) line 1 - 20.🔗 Which tag makes a clickable link? (a) <a> (b) <img> (c) <p> (d) <link>
-
21.💬 How many paragraphs show on the page?
<p>Cricket is fun.</p>
<!-- <p>Hello, world!</p> -->
<!-- <p>Our school trip</p> -->
<p>Rain today</p> -
22.📋 How many items does this list show?
<ul>
<li>Grapes</li>
<li>Jamun</li>
</ul> - 23.📋 Which list tag goes inside ul or ol? (a) <li> (b) <ul> (c) <ol>
- 24.📋 Which list tag is one item of a list? (a) <li> (b) <ol> (c) <ul>
-
25.🔗 Which words do you click on?
<a href="maths.html">Contact us</a> (a) Visit the site (b) maths.html (c) Contact us (d) href - 26.💬 Can anyone read your comments by viewing the page source? (a) Yes (b) No
-
27.🔍 Which line is missing its closing tag?
line 1: <u>I love mangoes.</u>
line 2: <h2>Our school trip
line 3: <b>Good morning!</b> (a) line 3 (b) line 2 (c) line 1 - 28.True or false: HTML on its own cannot run a game loop. (a) True (b) False
- 29.💬 How does an HTML comment end? (a) --> (b) */ (c) // (d) >>
- 30.True or false: <title> goes in the head. (a) False (b) True
- 31.True or false: a code editor is where we type code. (a) False (b) True
-
32.📋 How many items does this list show?
<ol>
<li>Jamun</li>
<li>Banana</li>
<li>Papaya</li>
<li>Grapes</li>
<li>Mango</li>
</ol> -
33.🔍 One closing tag is missing. Which one?
<h3>The red kite</h3>
<em>Good morning!</em>
<b>Rain today (a) </em> (b) </h3> (c) </b> (d) </h2> -
34.🔠 How many headings are in this code?
<h1>Hello, world!</h1>
<p>The red kite</p>
<p>My best friend</p> - 35.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <ul> (c) <meta charset="utf-8"> (d) <style>
-
36.🔗 Where does this link open?
<a href="quiz.html" target="_blank">Contact us</a> (a) in a new tab (b) in the same tab - 37.Which of these is a closing tag? (a) </h1> (b) <p> (c) <title> (d) <li>
- 38.Which of these goes in the head? (a) <link rel="stylesheet"> (b) <img> (c) <a> (d) <ul>
-
39.💬 Which text will NOT show on the page?
<p>Hello, world!</p>
<!-- <p>I love mangoes.</p> -->
<p>The red kite</p> (a) Hello, world! (b) I love mangoes. (c) The red kite -
40.📋 What number does the browser show next to “Orange”?
<ol start="4">
<li>Papaya</li>
<li>Orange</li>
<li>Banana</li>
</ol>
Answer key
- No
- src
- Yes
- 200
- a line across the page
- .html
- <!--
- <h6>
- <a href="about.html">
- My pets
- <!DOCTYPE html>
- 2
- <h6>
- <h1>
- <
- games.html
- True
- opens web pages for us
- line 1
- <a>
- 2
- 2
- <li>
- <li>
- Contact us
- Yes
- line 2
- True
- -->
- True
- True
- 5
- </b>
- 1
- <ul>
- in a new tab
- </h1>
- <link rel="stylesheet">
- I love mangoes.
- 5
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids