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 paragraphs does this code make?
<p>My pets</p>
<h2>Fun facts</h2>
<h2>Good morning!</h2>
<p>Hello, world!</p>
<h2>My pets</h2>
<h2>Hello, world!</h2> - 2.🔗 Which attribute holds the address of a link? (a) alt (b) id (c) src (d) href
-
3.📋 Does this list show bullets or numbers?
<ul>
<li>Guava</li>
<li>Grapes</li>
</ul> (a) bullets (b) numbers -
4.🔍 Which line is missing its closing tag?
line 1: <h3>The red kite
line 2: <p>My pets</p>
line 3: <u>Our school trip</u> (a) line 1 (b) line 3 (c) line 2 - 5.📋 Which list tag is one item of a list? (a) <ol> (b) <ul> (c) <li>
- 6.🔢 In a basic web page file, which comes first: “<html>” or “</body>”? (a) <html> (b) </body>
- 7.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h4> or <h3>? (a) <h2> (b) <h3> (c) <h4> (d) <h5>
-
8.🔗 Which words do you click on?
<a href="https://example.com">Visit the site</a> (a) Maths fun (b) https://example.com (c) Visit the site (d) href - 9.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a new line (c) as a dot (d) as 5 spaces
- 10.True or false: a code editor answers page requests. (a) False (b) True
-
11.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>My pets</p>
<h2>My best friend</h2>
<p>Fun facts</p> -
12.🔗 Which address opens when you click this link?
<a href="contact.html">Visit the site</a> (a) https://example.com (b) contact.html (c) Visit the site (d) maths.html - 13.True or false: HTML on its own cannot add pictures to a page. (a) True (b) False
- 14.🏷️ Which is the closing tag for <h2>? (a) <h2/> (b) </h2> (c) <\h2> (d) <h2>
- 15.True or false: <p> has a closing tag. (a) False (b) True
- 16.🔗 Which tag makes a clickable link? (a) <p> (b) <a> (c) <img> (d) <link>
- 17.Which of these is a closing tag? (a) <title> (b) </body> (c) <b> (d) <body>
- 18.🖼️ Which attribute of <img> sets how tall it is? (a) src (b) alt (c) height (d) width
- 19.🔠 Which heading shows the SMALLEST text: <h2>, <h3>, <h1> or <h4>? (a) <h1> (b) <h3> (c) <h4> (d) <h2>
- 20.🔠 Which tag is the least important heading? (a) <h1> (b) <h3> (c) <h6> (d) <p>
-
21.📝 How many paragraphs does this code make?
<p>Hello, world!</p>
<p>Cricket is fun.</p>
<p>Rain today</p>
<h2>Good morning!</h2>
<p>Cricket is fun.</p> -
22.💬 How many paragraphs show on the page?
<p>I love mangoes.</p>
<!-- <p>The red kite</p> -->
<p>Our school trip</p> -
23.📋 What number does the browser show next to “Banana”?
<ol>
<li>Grapes</li>
<li>Litchi</li>
<li>Banana</li>
</ol> - 24.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to leave notes (d) to show pictures
- 25.📄 Which part holds everything you see on the page? (a) the doctype (b) the title (c) the body (d) the head
- 26.Which of these goes in the head? (a) <a> (b) <title> (c) <img> (d) <p>
-
27.📋 What number does the browser show next to “Jamun”?
<ol>
<li>Banana</li>
<li>Papaya</li>
<li>Orange</li>
<li>Litchi</li>
<li>Jamun</li>
</ol> - 28.🔗 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">
- 29.💬 How does an HTML comment end? (a) // (b) >> (c) */ (d) -->
- 30.🖼️ Which attribute of <img> is read by screen readers? (a) width (b) src (c) alt (d) height
- 31.True or false: <br> has a closing tag. (a) False (b) True
-
32.📋 Does this list show bullets or numbers?
<ol>
<li>Mango</li>
<li>Banana</li>
<li>Orange</li>
</ol> (a) numbers (b) bullets - 33.🔍 Which is the odd one out? (a) opens web pages for us (b) colours code to help us (c) has an address bar (d) shows pages from the web
- 34.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
- 35.True or false: HTML on its own can make links to pages. (a) False (b) True
-
36.📋 What number does the browser show next to “Grapes”?
<ol>
<li>Litchi</li>
<li>Mango</li>
<li>Guava</li>
<li>Grapes</li>
</ol> -
37.🔗 Which address opens when you click this link?
<a href="maths.html">About us</a> (a) art.html (b) About us (c) news.html (d) maths.html - 38.🌍 Which program shows a web page to us? (a) a paint program (b) a calculator (c) a music player (d) a web browser
- 39.Which of these is true of a code editor? (a) has an address bar (b) shows pages from the web (c) opens web pages for us (d) saves our .html files
-
40.📝 How many paragraphs does this code make?
<p>My pets</p>
<p>Good morning!</p>
<h2>My best friend</h2>
Answer key
- 2
- href
- bullets
- line 1
- <li>
- <html>
- <h5>
- Visit the site
- as one space
- False
- 3
- contact.html
- False
- </h2>
- True
- <a>
- </body>
- height
- <h4>
- <h6>
- 4
- 2
- 3
- to leave notes
- the body
- <title>
- 5
- <a href="about.html">
- -->
- alt
- False
- numbers
- colours code to help us
- in the body
- True
- 4
- maths.html
- a web browser
- saves our .html files
- 2
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids