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.🔗 Where does this link open?
<a href="art.html">Maths fun</a> (a) in a new tab (b) in the same tab - 2.🏷️ Is </body> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
-
3.🖼️ How many pixels wide is the picture drawn?
<img src="cake.jpg" alt="Birthday cake" width="100"> - 4.🏷️ Is </li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 5.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a alt="about.html"> (d) <a src="about.html">
-
6.📋 How many items does this list show?
<ul>
<li>Banana</li>
<li>Jamun</li>
<li>Orange</li>
<li>Mango</li>
</ul> - 7.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h3> or <h4>? (a) <h4> (b) <h1> (c) <h5> (d) <h3>
-
8.🔠 How many headings are in this code?
<h1>My best friend</h1>
<p>Cricket is fun.</p>
<h2>Our school trip</h2>
<p>Hello, world!</p>
<p>Rain today</p> - 9.True or false: in <img>, src tells which image to load. (a) True (b) False
- 10.📝 What does <p> make? (a) a picture (b) a table (c) a paragraph (d) a link
- 11.💬 How does an HTML comment start? (a) /* (b) # (c) <!-- (d) //
-
12.📝 How many paragraphs does this code make?
<p>The red kite</p>
<p>Hello, world!</p>
<p>My pets</p>
<p>Rain today</p> -
13.🔍 One closing tag is missing. Which one?
<u>The red kite</u>
<small>Cricket is fun.
<em>My pets</em> (a) </h2> (b) </em> (c) </small> (d) </u> -
14.🔗 Where does this link open?
<a href="https://example.com">Maths fun</a> (a) in a new tab (b) in the same tab - 15.Which of these is true of a code editor? (a) hosts websites online (b) saves our .html files (c) has an address bar (d) shows pages from the web
- 16.📝 Does <p> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
- 17.🔢 In a basic web page file, which comes first: “<html>” or “<head>”? (a) <html> (b) <head>
- 18.📋 Which list shows the steps of a recipe best? (a) <ol> (b) <ul> (c) <br> (d) <hr>
-
19.📋 Does this list show bullets or numbers?
<ol>
<li>Guava</li>
<li>Mango</li>
</ol> (a) numbers (b) bullets -
20.📋 Does this list show bullets or numbers?
<ol>
<li>Mango</li>
<li>Guava</li>
<li>Banana</li>
</ol> (a) numbers (b) bullets -
21.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>I love mangoes.</p> -->
<!-- <p>Cricket is fun.</p> -->
<!-- <p>Hello, world!</p> --> - 22.📋 Which list tag shows bullet points? (a) <ul> (b) <ol> (c) <li>
- 23.Which of these is a closing tag? (a) </b> (b) <h1> (c) <body> (d) <b>
-
24.📄 What is the big heading shown on this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>All about me</h1>
<p>I like to read.</p>
</body>
</html> (a) Space Facts (b) I like to read. (c) All about me (d) body - 25.🌐 Which one turns HTML into a page? (a) a web server (b) a code editor (c) a web browser
-
26.🔗 Which address opens when you click this link?
<a href="contact.html">Maths fun</a> (a) https://example.com (b) contact.html (c) maths.html (d) Maths fun - 27.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h5> or <h4>? (a) <h5> (b) <h4> (c) <h6> (d) <h2>
- 28.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) height (c) alt (d) width
- 29.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) alt (c) width (d) height
- 30.📄 Where does <img> go: in the head or in the body? (a) in the head (b) in the body
- 31.True or false: a web server has an address bar. (a) False (b) True
- 32.True or false: in <img>, alt is read by screen readers. (a) True (b) False
-
33.🔍 One closing tag is missing. Which one?
<h3>Good morning!</h3>
<b>Rain today
<h2>My best friend</h2> (a) </b> (b) </h2> (c) </h3> (d) </em> - 34.Which of these is an opening tag? (a) <h1> (b) </title> (c) </b> (d) </h1>
- 35.🌐 Which one hosts websites online? (a) a web browser (b) a web server (c) a code editor
- 36.🔤 In “HTML”, what does the M stand for? (a) Modern (b) Machine (c) Markup (d) Mouse
-
37.💬 Which text will NOT show on the page?
<p>My pets</p>
<p>Our school trip</p>
<!-- <p>Good morning!</p> --> (a) Good morning! (b) Our school trip (c) My pets -
38.🔗 Which words do you click on?
<a href="about.html">Contact us</a> (a) about.html (b) href (c) Visit the site (d) Contact us -
39.🔍 One closing tag is missing. Which one?
<i>Fun facts</i>
<small>The red kite
<h3>I love mangoes.</h3> (a) </h1> (b) </small> (c) </h3> (d) </i> - 40.True or false: <meta> has a closing tag. (a) True (b) False
Answer key
- in the same tab
- a closing tag
- 100
- a closing tag
- <a href="about.html">
- 4
- <h1>
- 2
- True
- a paragraph
- <!--
- 4
- </small>
- in the same tab
- saves our .html files
- has a closing tag
- <html>
- <ol>
- numbers
- numbers
- 1
- <ul>
- </b>
- All about me
- a web browser
- contact.html
- <h2>
- alt
- width
- in the body
- False
- True
- </b>
- <h1>
- a web server
- Markup
- Good morning!
- Contact us
- </small>
- False
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids