← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 515 · 40 questions
TalentJR

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. 1.🏷️ Is </li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  2. 2.🔗 Which address opens when you click this link?
    <a href="contact.html">Play games</a>
    (a) Play games (b) https://example.com (c) contact.html (d) maths.html
  3. 3.🖼️ Which tag puts a picture on a page? (a) <pic> (b) <p> (c) <img> (d) <a>
  4. 4.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) body (b) Space Facts (c) Welcome! (d) Mars is red.
  5. 5.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>We won by 5 runs.</p>
    </body>
    </html>
    (a) Welcome! (b) index.html (c) Class 7 Blog (d) We won by 5 runs.
  6. 6.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h5> or <h6>? (a) <h4> (b) <h6> (c) <h5> (d) <h2>
  7. 7.🔠 Which heading shows the BIGGEST text: <h2>, <h5>, <h1> or <h3>? (a) <h1> (b) <h5> (c) <h3> (d) <h2>
  8. 8.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) makes it blank (d) hides the link
  9. 9.🔍 One closing tag is missing. Which one?
    <strong>Hello, world!</strong>
    <u>Good morning!
    <p>I love mangoes.</p>
    (a) </p> (b) </strong> (c) </em> (d) </u>
  10. 10.💬 How many paragraphs show on the page?
    <p>Our school trip</p>
    <!-- <p>Hello, world!</p> -->
    <p>Cricket is fun.</p>
    <p>Fun facts</p>
    <p>Good morning!</p>
  11. 11.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Art Gallery (b) body (c) Easy snacks (d) Try this poha.
  12. 12.📄 Which part holds everything you see on the page? (a) the head (b) the body (c) the doctype (d) the title
  13. 13.🔠 How many headings are in this code?
    <h1>Fun facts</h1>
    <p>Fun facts</p>
    <p>Cricket is fun.</p>
    <h3>The red kite</h3>
  14. 14.🔍 Which line is missing its closing tag?
    line 1: <b>Hello, world!</b>
    line 2: <small>Rain today</small>
    line 3: <p>The red kite
    (a) line 1 (b) line 2 (c) line 3
  15. 15.🖼️ Which picture file does the browser load?
    <img src="cake.jpg" alt="Birthday cake" width="100">
    (a) Birthday cake (b) dog.jpg (c) cake.jpg (d) moon.png
  16. 16.🔍 Which line is missing its closing tag?
    line 1: <b>My pets</b>
    line 2: <em>Fun facts
    line 3: <p>Good morning!</p>
    (a) line 1 (b) line 2 (c) line 3
  17. 17.🔗 Which words do you click on?
    <a href="quiz.html">About us</a>
    (a) Contact us (b) About us (c) href (d) quiz.html
  18. 18.🔍 Which is the odd one out? (a) turns HTML into a page (b) stores a website’s files (c) answers page requests (d) hosts websites online
  19. 19.🌐 Which one stores a website’s files? (a) a web server (b) a web browser (c) a code editor
  20. 20.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to describe the image (c) to colour it (d) to load it faster
  21. 21.Which of these is true of a code editor? (a) turns HTML into a page (b) hosts websites online (c) shows pages from the web (d) shows line numbers
  22. 22.📋 How many items does this list show?
    <ol>
      <li>Banana</li>
      <li>Jamun</li>
    </ol>
  23. 23.📋 Which list tag is an ordered list? (a) <ol> (b) <li> (c) <ul>
  24. 24.🔍 Which line is missing its closing tag?
    line 1: <small>I love mangoes.
    line 2: <h3>Hello, world!</h3>
    line 3: <strong>The red kite</strong>
    (a) line 3 (b) line 2 (c) line 1
  25. 25.📋 Which list tag is an unordered list? (a) <ol> (b) <ul> (c) <li>
  26. 26.🔠 How many heading levels does HTML have? (a) 3 (b) 4 (c) 6 (d) 10
  27. 27.True or false: a web browser stores a website’s files. (a) True (b) False
  28. 28.📋 What number does the browser show next to “Grapes”?
    <ol>
      <li>Jamun</li>
      <li>Grapes</li>
      <li>Papaya</li>
      <li>Litchi</li>
      <li>Mango</li>
    </ol>
  29. 29.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="250">
    (a) A red kite (b) tiger.jpg (c) A tiger asleep (d) width
  30. 30.💬 Why do coders write comments? (a) to show pictures (b) to make links (c) to leave notes (d) to add colour
  31. 31.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) body (b) My Hobbies (c) Match report (d) Here is my best one.
  32. 32.🔠 Which heading shows the BIGGEST text: <h6>, <h5>, <h4> or <h2>? (a) <h4> (b) <h6> (c) <h2> (d) <h5>
  33. 33.🔍 Which line is missing its closing tag?
    line 1: <strong>The red kite</strong>
    line 2: <h3>Fun facts</h3>
    line 3: <b>My pets
    (a) line 3 (b) line 2 (c) line 1
  34. 34.💬 Which text will NOT show on the page?
    <p>Our school trip</p>
    <!-- <p>My best friend</p> -->
    <p>Rain today</p>
    (a) Rain today (b) Our school trip (c) My best friend
  35. 35.🔍 One closing tag is missing. Which one?
    <h2>Our school trip</h2>
    <u>Good morning!</u>
    <h3>My pets
    (a) </h3> (b) </h2> (c) </strong> (d) </u>
  36. 36.📝 Does <br> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  37. 37.💬 How many paragraphs show on the page?
    <!-- <p>Rain today</p> -->
    <p>Cricket is fun.</p>
    <!-- <p>Fun facts</p> -->
    <!-- <p>Our school trip</p> -->
  38. 38.📋 What number does the browser show next to “Jamun”?
    <ol start="9">
      <li>Litchi</li>
      <li>Jamun</li>
      <li>Guava</li>
      <li>Grapes</li>
      <li>Banana</li>
    </ol>
  39. 39.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) body (b) Thanks for visiting. (c) Easy snacks (d) My Hobbies
  40. 40.🖼️ Does <img> need a closing tag? (a) No (b) Yes

Answer key

  1. a closing tag
  2. contact.html
  3. <img>
  4. Welcome!
  5. Class 7 Blog
  6. <h6>
  7. <h1>
  8. opens it in a new tab
  9. </u>
  10. 4
  11. Easy snacks
  12. the body
  13. 2
  14. line 3
  15. cake.jpg
  16. line 2
  17. About us
  18. turns HTML into a page
  19. a web server
  20. to describe the image
  21. shows line numbers
  22. 2
  23. <ol>
  24. line 1
  25. <ul>
  26. 6
  27. False
  28. 2
  29. A tiger asleep
  30. to leave notes
  31. Match report
  32. <h2>
  33. line 3
  34. My best friend
  35. </h3>
  36. an empty tag
  37. 1
  38. 10
  39. Easy snacks
  40. No

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids