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 has a closing tag? (a) <b> (b) <img> (c) <br> (d) <hr>
-
2.💬 How many paragraphs show on the page?
<!-- <p>Rain today</p> -->
<p>Cricket is fun.</p>
<!-- <p>Our school trip</p> -->
<!-- <p>Good morning!</p> --> -
3.🔍 Which line is missing its closing tag?
line 1: <strong>Our school trip</strong>
line 2: <i>Rain today
line 3: <p>Cricket is fun.</p> (a) line 2 (b) line 3 (c) line 1 - 4.🔗 What does target="_blank" do to a link? (a) makes it blank (b) makes it bold (c) hides the link (d) opens it in a new tab
- 5.🖼️ Which tag puts a picture on a page? (a) <a> (b) <p> (c) <img> (d) <pic>
-
6.🔍 One closing tag is missing. Which one?
<em>Hello, world!</em>
<h2>The red kite</h2>
<i>My pets (a) </em> (b) </i> (c) </h2> (d) </h3> - 7.🏷️ Is <body> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 8.📝 What does <hr> draw? (a) a table (b) a picture (c) a line across the page (d) a link
- 9.🔢 In a basic web page file, which comes first: “<!DOCTYPE html>” or “<html>”? (a) <html> (b) <!DOCTYPE html>
- 10.🏷️ Every HTML tag starts with which sign? (a) [ (b) < (c) ( (d) {
- 11.🔠 Are headings shown in bold by default? (a) Yes (b) No
-
12.🔍 One closing tag is missing. Which one?
<h2>Rain today</h2>
<u>The red kite</u>
<b>Good morning! (a) </b> (b) </h2> (c) </u> (d) </h1> - 13.🔠 Which heading shows the SMALLEST text: <h5>, <h4>, <h6> or <h2>? (a) <h5> (b) <h4> (c) <h6> (d) <h2>
- 14.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as one space (c) as a new line (d) as a dot
- 15.🖼️ Which attribute of <img> names the picture file? (a) height (b) src (c) width (d) alt
-
16.🔍 One closing tag is missing. Which one?
<b>Cricket is fun.
<small>Our school trip</small>
<i>Rain today</i> (a) </em> (b) </small> (c) </i> (d) </b> -
17.💬 How many paragraphs show on the page?
<p>My best friend</p>
<p>Hello, world!</p>
<!-- <p>Cricket is fun.</p> -->
<!-- <p>My pets</p> --> - 18.True or false: <br> is an empty tag. (a) False (b) True
- 19.📛 In <a href="x.html">, what is href? (a) an attribute (b) a comment (c) an element name (d) a closing tag
- 20.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
- 21.True or false: <h1> has a closing tag. (a) False (b) True
- 22.🔠 How many <h1> headings should a page usually have? (a) 6 (b) 3 (c) 10 (d) 1
-
23.💬 How many paragraphs show on the page?
<p>The red kite</p>
<!-- <p>Our school trip</p> -->
<p>Hello, world!</p>
<!-- <p>Rain today</p> -->
<p>I love mangoes.</p> -
24.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>I love mangoes.</p>
<h2>My best friend</h2>
<p>Hello, world!</p> - 25.True or false: <li> shows bullet points. (a) False (b) True
- 26.🔤 In “HTML”, what does the M stand for? (a) Mouse (b) Machine (c) Markup (d) Modern
-
27.📝 On how many lines does the browser show this paragraph?
<p>Roses are red<br>Kites fly high<br>Stars shine<br>Sky is blue<br>Rivers flow</p> - 28.🔠 Which heading shows the SMALLEST text: <h2>, <h1>, <h3> or <h6>? (a) <h2> (b) <h3> (c) <h1> (d) <h6>
- 29.🏷️ What does a closing tag have that an opening tag does not? (a) a hash # (b) a dollar $ (c) a dot . (d) a slash /
- 30.💬 How does an HTML comment end? (a) >> (b) --> (c) // (d) */
-
31.🔍 One closing tag is missing. Which one?
<h3>Hello, world!</h3>
<i>Rain today
<strong>The red kite</strong> (a) </em> (b) </strong> (c) </i> (d) </h3> - 32.📋 Which list tag lists steps in order? (a) <ol> (b) <li> (c) <ul>
-
33.💬 Which text will NOT show on the page?
<p>Fun facts</p>
<p>I love mangoes.</p>
<p>My pets</p>
<!-- <p>My best friend</p> --> (a) Fun facts (b) My best friend (c) My pets (d) I love mangoes. - 34.Which of these has a closing tag? (a) <meta> (b) <title> (c) <img> (d) <hr>
-
35.🔗 Which address opens when you click this link?
<a href="about.html">Contact us</a> (a) about.html (b) contact.html (c) https://example.com (d) Contact us - 36.True or false: in <img>, src tells which image to load. (a) True (b) False
-
37.🔍 One closing tag is missing. Which one?
<h3>Hello, world!
<p>The red kite</p>
<h1>I love mangoes.</h1> (a) </u> (b) </h1> (c) </p> (d) </h3> -
38.💬 Which text will NOT show on the page?
<p>I love mangoes.</p>
<p>My pets</p>
<!-- <p>Cricket is fun.</p> --> (a) I love mangoes. (b) My pets (c) Cricket is fun. - 39.Which of these goes in the head? (a) <title> (b) <h1> (c) <table> (d) <img>
- 40.🔠 Which tag is the least important heading? (a) <p> (b) <h6> (c) <h3> (d) <h1>
Answer key
- <b>
- 1
- line 2
- opens it in a new tab
- <img>
- </i>
- an opening tag
- a line across the page
- <!DOCTYPE html>
- <
- Yes
- </b>
- <h6>
- as one space
- src
- </b>
- 2
- True
- an attribute
- Yes
- True
- 1
- 3
- 3
- False
- Markup
- 5
- <h6>
- a slash /
- -->
- </i>
- <ol>
- My best friend
- <title>
- about.html
- True
- </h3>
- Cricket is fun.
- <title>
- <h6>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids