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 attribute of <img> shows if the image fails? (a) src (b) alt (c) height (d) width
- 2.📄 Which part holds everything you see on the page? (a) the body (b) the doctype (c) the title (d) the head
- 3.🔠 Which heading shows the BIGGEST text: <h2>, <h3>, <h6> or <h4>? (a) <h2> (b) <h4> (c) <h3> (d) <h6>
- 4.🔠 Which heading shows the BIGGEST text: <h3>, <h4>, <h2> or <h1>? (a) <h1> (b) <h2> (c) <h4> (d) <h3>
-
5.📝 On how many lines does the browser show this paragraph?
<p>Birds sing<br>Stars shine</p> - 6.🔍 Which is the odd one out? (a) stores a website’s files (b) answers page requests (c) has an address bar (d) hosts websites online
- 7.📝 What does <br> do? (a) starts a new line (b) makes text bold (c) makes a list (d) adds a picture
- 8.🖼️ Which attribute of <img> sets how tall it is? (a) width (b) alt (c) src (d) height
-
9.📋 How many items does this list show?
<ul>
<li>Banana</li>
<li>Guava</li>
<li>Jamun</li>
<li>Grapes</li>
<li>Mango</li>
<li>Litchi</li>
</ul> - 10.True or false: HTML on its own can add up two numbers. (a) False (b) True
- 11.📋 Which list tag shows 1, 2, 3 numbers? (a) <ol> (b) <li> (c) <ul>
-
12.📋 What number does the browser show next to “Banana”?
<ol start="9">
<li>Guava</li>
<li>Mango</li>
<li>Orange</li>
<li>Grapes</li>
<li>Banana</li>
<li>Jamun</li>
</ol> - 13.🔢 In a basic web page file, which comes first: “</body>” or “</html>”? (a) </html> (b) </body>
- 14.🏷️ Is </li> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
- 15.📛 In <a href="x.html">, what is href? (a) an element name (b) a closing tag (c) a comment (d) an attribute
-
16.🔗 Which words do you click on?
<a href="https://example.com">About us</a> (a) Contact us (b) https://example.com (c) About us (d) href -
17.💬 Which text will NOT show on the page?
<!-- <p>Rain today</p> -->
<p>I love mangoes.</p>
<p>The red kite</p>
<p>My pets</p> (a) My pets (b) I love mangoes. (c) Rain today (d) The red kite -
18.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>My Hobbies</title>
</head>
<body>
<h1>Easy snacks</h1>
<p>Here is my best one.</p>
</body>
</html> (a) My Hobbies (b) Easy snacks (c) Here is my best one. (d) index.html - 19.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h4> or <h1>? (a) <h5> (b) <h4> (c) <h1> (d) <h2>
- 20.True or false: a code editor is where we type code. (a) False (b) True
- 21.📄 What is the first line of an HTML5 page? (a) <body> (b) <!DOCTYPE html> (c) <head> (d) <html>
- 22.🔍 Which is the odd one out? (a) answers page requests (b) is where we type code (c) sends pages over the net (d) hosts websites online
-
23.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Class 7 Blog</title>
</head>
<body>
<h1>Planets</h1>
<p>Thanks for visiting.</p>
</body>
</html> (a) Planets (b) index.html (c) Class 7 Blog (d) Thanks for visiting. - 24.📋 Which list suits a shopping list in any order? (a) <ol> (b) <ul> (c) <hr> (d) <br>
- 25.Which of these has a closing tag? (a) <br> (b) <meta> (c) <input> (d) <title>
- 26.🔍 Which is the odd one out? (a) opens web pages for us (b) stores a website’s files (c) sends pages over the net (d) hosts websites online
- 27.True or false: in <img>, alt describes the picture. (a) False (b) True
- 28.True or false: <hr> has a closing tag. (a) False (b) True
-
29.📋 Does this list show bullets or numbers?
<ol>
<li>Banana</li>
<li>Litchi</li>
<li>Mango</li>
</ol> (a) bullets (b) numbers -
30.📋 Does this list show bullets or numbers?
<ul>
<li>Papaya</li>
<li>Mango</li>
</ul> (a) numbers (b) bullets - 31.True or false: <p> is an empty tag. (a) True (b) False
- 32.🌐 Which one saves our .html files? (a) a web server (b) a code editor (c) a web browser
- 33.🖼️ Which attribute of <img> describes the picture? (a) src (b) height (c) alt (d) width
- 34.🔠 Which heading shows the BIGGEST text: <h4>, <h3>, <h1> or <h2>? (a) <h3> (b) <h4> (c) <h2> (d) <h1>
- 35.📝 Does <br> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
-
36.💬 How many paragraphs show on the page?
<p>Good morning!</p>
<p>Hello, world!</p>
<!-- <p>Our school trip</p> --> - 37.🔗 What does target="_blank" do to a link? (a) hides the link (b) makes it bold (c) opens it in a new tab (d) makes it blank
-
38.📝 How many paragraphs does this code make?
<p>Fun facts</p>
<p>Our school trip</p>
<p>My pets</p>
<p>Good morning!</p> -
39.🖼️ Which picture file does the browser load?
<img src="fort.jpg" alt="An old fort" width="50"> (a) kite.png (b) fort.jpg (c) tiger.jpg (d) An old fort - 40.🔠 Which heading shows the SMALLEST text: <h5>, <h1>, <h4> or <h3>? (a) <h5> (b) <h4> (c) <h1> (d) <h3>
Answer key
- alt
- the body
- <h2>
- <h1>
- 2
- has an address bar
- starts a new line
- height
- 6
- False
- <ol>
- 13
- </body>
- a closing tag
- an attribute
- About us
- Rain today
- My Hobbies
- <h1>
- True
- <!DOCTYPE html>
- is where we type code
- Class 7 Blog
- <ul>
- <title>
- opens web pages for us
- True
- False
- numbers
- bullets
- False
- a code editor
- alt
- <h1>
- an empty tag
- 2
- opens it in a new tab
- 4
- fort.jpg
- <h5>
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids