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 goes in the body? (a) <title> (b) <meta charset="utf-8"> (c) <a> (d) <link rel="stylesheet">
- 2.🔗 What does target="_blank" do to a link? (a) makes it blank (b) hides the link (c) makes it bold (d) opens it in a new tab
- 3.True or false: <link rel="stylesheet"> goes in the body. (a) True (b) False
- 4.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a dot . (c) a hash # (d) a slash /
- 5.📄 Where does <meta charset="utf-8"> go: in the head or in the body? (a) in the head (b) in the body
- 6.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h2> or <h3>? (a) <h6> (b) <h1> (c) <h3> (d) <h2>
-
7.💬 Which text will NOT show on the page?
<p>Rain today</p>
<p>The red kite</p>
<!-- <p>Our school trip</p> --> (a) The red kite (b) Our school trip (c) Rain today - 8.Which of these is true of a code editor? (a) saves our .html files (b) answers page requests (c) opens web pages for us (d) shows pages from the web
- 9.🔢 In a basic web page file, which comes LAST? (a) <html> (b) </head> (c) </html> (d) <head>
-
10.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="300"> (a) A happy dog (b) Birthday cake (c) width (d) cake.jpg -
11.🔠 How many headings are in this code?
<h1>My best friend</h1>
<h4>Good morning!</h4>
<h4>Our school trip</h4>
<h2>The red kite</h2> -
12.🔍 Which line is missing its closing tag?
line 1: <h3>Hello, world!</h3>
line 2: <h1>Our school trip
line 3: <i>My best friend</i> (a) line 2 (b) line 3 (c) line 1 - 13.True or false: <img> is an empty tag. (a) False (b) True
-
14.🖼️ How many pixels wide is the picture drawn?
<img src="dog.jpg" alt="A happy dog" width="100"> - 15.True or false: <ul> goes in the body. (a) True (b) False
- 16.🔍 Which is the odd one out? (a) stores a website’s files (b) saves our .html files (c) hosts websites online (d) answers page requests
- 17.🖼️ Which attribute of <img> sets how tall it is? (a) src (b) alt (c) height (d) width
- 18.📝 Does <input> have a closing tag, or is it an empty tag? (a) has a closing tag (b) an empty tag
- 19.📝 What does <hr> draw? (a) a table (b) a link (c) a picture (d) a line across the page
- 20.Which of these is true of a web server? (a) sends pages over the net (b) turns HTML into a page (c) shows line numbers (d) is where we type code
- 21.🌐 Which one opens web pages for us? (a) a code editor (b) a web server (c) a web browser
- 22.🔠 Which heading shows the BIGGEST text: <h4>, <h5>, <h6> or <h2>? (a) <h2> (b) <h4> (c) <h6> (d) <h5>
-
23.💬 How many paragraphs show on the page?
<p>Fun facts</p>
<!-- <p>Our school trip</p> -->
<!-- <p>Cricket is fun.</p> --> -
24.📄 What does the browser tab show for this page?
<!DOCTYPE html>
<html>
<head>
<title>Art Gallery</title>
</head>
<body>
<h1>Welcome!</h1>
<p>Mars is red.</p>
</body>
</html> (a) Art Gallery (b) Mars is red. (c) index.html (d) Welcome! - 25.🔗 Which tag makes a clickable link? (a) <img> (b) <link> (c) <a> (d) <p>
- 26.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a src="about.html"> (d) <a alt="about.html">
- 27.🖼️ Which attribute of <img> names the picture file? (a) width (b) src (c) height (d) alt
- 28.🏷️ Is </p> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
- 29.Which of these is true of a web browser? (a) saves our .html files (b) has an address bar (c) answers page requests (d) hosts websites online
- 30.🔠 Which heading shows the BIGGEST text: <h6>, <h4>, <h3> or <h5>? (a) <h6> (b) <h5> (c) <h4> (d) <h3>
-
31.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="100"> (a) bus.jpg (b) width (c) Our school bus (d) An old fort -
32.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="50"> (a) Map of India (b) cake.jpg (c) map.png (d) dog.jpg - 33.🔍 Which is the odd one out? (a) stores a website’s files (b) hosts websites online (c) opens web pages for us (d) sends pages over the net
-
34.🔗 Where does this link open?
<a href="maths.html">About us</a> (a) in the same tab (b) in a new tab -
35.🔗 Which address opens when you click this link?
<a href="news.html">Take the quiz</a> (a) Take the quiz (b) news.html (c) quiz.html (d) games.html - 36.🔍 Which is the odd one out? (a) answers page requests (b) turns HTML into a page (c) sends pages over the net (d) stores a website’s files
-
37.💬 How many paragraphs show on the page?
<!-- <p>Fun facts</p> -->
<p>I love mangoes.</p>
<p>Our school trip</p>
<p>My pets</p> -
38.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="150"> (a) cake.jpg (b) dog.jpg (c) map.png (d) Map of India - 39.🔍 Which is the odd one out? (a) stores a website’s files (b) sends pages over the net (c) hosts websites online (d) shows pages from the web
-
40.🔗 Which words do you click on?
<a href="about.html">Play games</a> (a) About us (b) Play games (c) href (d) about.html
Answer key
- <a>
- opens it in a new tab
- False
- a slash /
- in the head
- <h6>
- Our school trip
- saves our .html files
- </html>
- Birthday cake
- 4
- line 2
- True
- 100
- True
- saves our .html files
- height
- an empty tag
- a line across the page
- sends pages over the net
- a web browser
- <h2>
- 1
- Art Gallery
- <a>
- <a href="about.html">
- src
- a closing tag
- has an address bar
- <h3>
- Our school bus
- map.png
- opens web pages for us
- in the same tab
- news.html
- turns HTML into a page
- 3
- map.png
- shows pages from the web
- Play games
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids