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 does an HTML comment end? (a) --> (b) */ (c) // (d) >>
-
2.📝 How many paragraphs does this code make?
<p>My pets</p>
<p>Hello, world!</p>
<p>My pets</p>
<p>Rain today</p>
<p>Good morning!</p> - 3.📝 What does <br> do? (a) makes a list (b) adds a picture (c) makes text bold (d) starts a new line
- 4.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) height (d) width
-
5.🔗 Where does this link open?
<a href="art.html" target="_blank">Art corner</a> (a) in the same tab (b) in a new tab - 6.📋 Which list suits a shopping list in any order? (a) <ol> (b) <hr> (c) <br> (d) <ul>
-
7.📋 What number does the browser show next to “Orange”?
<ol>
<li>Guava</li>
<li>Jamun</li>
<li>Grapes</li>
<li>Orange</li>
</ol> - 8.📄 Can HTML on its own make headings? (a) No (b) Yes
- 9.🔗 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">
- 10.📄 Where does <a> go: in the head or in the body? (a) in the body (b) in the head
-
11.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="250"> (a) bus.jpg (b) fort.jpg (c) The full moon (d) moon.png - 12.True or false: <li> is an empty tag. (a) False (b) True
- 13.📋 Which list tag is an unordered list? (a) <ul> (b) <li> (c) <ol>
- 14.🔗 Which tag makes a clickable link? (a) <img> (b) <a> (c) <p> (d) <link>
- 15.Which of these is true of a web browser? (a) stores a website’s files (b) sends pages over the net (c) shows line numbers (d) opens web pages for us
-
16.💬 Which text will NOT show on the page?
<!-- <p>Good morning!</p> -->
<p>My best friend</p>
<p>Fun facts</p> (a) Fun facts (b) My best friend (c) Good morning! - 17.Which of these is true of a web browser? (a) has an address bar (b) saves our .html files (c) answers page requests (d) hosts websites online
- 18.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) </head> (c) </html> (d) <head>
-
19.💬 How many paragraphs show on the page?
<!-- <p>Good morning!</p> -->
<p>Rain today</p>
<!-- <p>My best friend</p> -->
<!-- <p>My pets</p> -->
<p>Fun facts</p> -
20.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Space Facts</title>
</head>
<body>
<h1>Planets</h1>
<p>Mars is red.</p>
</body>
</html> (a) Mars is red. (b) Planets (c) Space Facts (d) index.html - 21.📄 Where does <style> go: in the head or in the body? (a) in the body (b) in the head
- 22.True or false: <style> goes in the head. (a) False (b) True
- 23.🔠 Are headings shown in bold by default? (a) Yes (b) No
- 24.🔗 Which attribute holds the address of a link? (a) id (b) alt (c) src (d) href
-
25.💬 How many paragraphs show on the page?
<!-- <p>My best friend</p> -->
<!-- <p>I love mangoes.</p> -->
<!-- <p>Our school trip</p> -->
<p>Hello, world!</p> - 26.Which of these is true of a code editor? (a) turns HTML into a page (b) answers page requests (c) stores a website’s files (d) is where we type code
- 27.📋 Which list tag lists things in any order? (a) <ol> (b) <ul> (c) <li>
-
28.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="tiger.jpg" alt="A tiger asleep" width="50"> (a) A tiger asleep (b) width (c) tiger.jpg (d) A red kite - 29.🏷️ Which is the closing tag for <em>? (a) <\em> (b) <em/> (c) <em> (d) </em>
-
30.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>I like to read.</p>
</body>
</html> (a) Class 7 Blog (b) index.html (c) Easy snacks (d) I like to read. - 31.🌐 Which one colours code to help us? (a) a code editor (b) a web browser (c) a web server
- 32.Which of these is true of a code editor? (a) answers page requests (b) saves our .html files (c) shows pages from the web (d) turns HTML into a page
- 33.🔠 Which heading shows the SMALLEST text: <h5>, <h6>, <h3> or <h1>? (a) <h1> (b) <h3> (c) <h6> (d) <h5>
-
34.🔗 Which address opens when you click this link?
<a href="maths.html">Play games</a> (a) maths.html (b) art.html (c) news.html (d) Play games -
35.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>My drawings</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Thanks for visiting. (b) My drawings (c) index.html (d) Art Gallery - 36.🏷️ Is <li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 37.📄 Can HTML on its own run a game loop? (a) Yes (b) No
-
38.💬 How many paragraphs show on the page?
<p>My best friend</p>
<!-- <p>Good morning!</p> -->
<!-- <p>Fun facts</p> --> -
39.💬 How many paragraphs show on the page?
<!-- <p>Hello, world!</p> -->
<!-- <p>Rain today</p> -->
<!-- <p>Our school trip</p> -->
<p>My pets</p> - 40.🏷️ Is <title> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
Answer key
- -->
- 5
- starts a new line
- alt
- in a new tab
- <ul>
- 4
- Yes
- <a href="about.html">
- in the body
- moon.png
- False
- <ul>
- <a>
- opens web pages for us
- Good morning!
- has an address bar
- </html>
- 2
- Space Facts
- in the head
- True
- Yes
- href
- 1
- is where we type code
- <ul>
- A tiger asleep
- </em>
- Class 7 Blog
- a code editor
- saves our .html files
- <h6>
- maths.html
- Art Gallery
- an opening tag
- No
- 1
- 1
- an opening tag
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids