← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 706 · 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.🔠 How many headings are in this code?
    <h1>My best friend</h1>
    <h2>The red kite</h2>
    <p>Fun facts</p>
    <h3>Cricket is fun.</h3>
  2. 2.🔗 Which code links to about.html? (a) <a href="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a src="about.html">
  3. 3.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) makes a list (d) starts a new line
  4. 4.📄 Where does <h1> go: in the head or in the body? (a) in the head (b) in the body
  5. 5.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="200">
  6. 6.🔗 What does target="_blank" do to a link? (a) hides the link (b) opens it in a new tab (c) makes it bold (d) makes it blank
  7. 7.🏷️ Is <body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  8. 8.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a new line (b) as a dot (c) as 5 spaces (d) as one space
  9. 9.🖼️ Which attribute of <img> tells which image to load? (a) width (b) alt (c) src (d) height
  10. 10.💬 Which text will NOT show on the page?
    <!-- <p>My best friend</p> -->
    <p>Cricket is fun.</p>
    <p>Good morning!</p>
    (a) Good morning! (b) Cricket is fun. (c) My best friend
  11. 11.🏷️ Which is the closing tag for <h2>? (a) <\h2> (b) <h2/> (c) </h2> (d) <h2>
  12. 12.🔗 Where does this link open?
    <a href="maths.html" target="_blank">Art corner</a>
    (a) in a new tab (b) in the same tab
  13. 13.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="50">
  14. 14.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Riya’s Recipes</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>I like to read.</p>
    </body>
    </html>
    (a) body (b) I like to read. (c) Riya’s Recipes (d) Easy snacks
  15. 15.💬 How does an HTML comment end? (a) >> (b) --> (c) // (d) */
  16. 16.True or false: <table> goes in the body. (a) False (b) True
  17. 17.🔗 Which words do you click on?
    <a href="about.html">About us</a>
    (a) href (b) About us (c) Contact us (d) about.html
  18. 18.📝 What do we need to write HTML? (a) a printer (b) a microphone (c) a plain text editor (d) a paintbrush
  19. 19.🔠 How many heading levels does HTML have? (a) 10 (b) 6 (c) 4 (d) 3
  20. 20.🔍 One closing tag is missing. Which one?
    <h1>Fun facts
    <u>My pets</u>
    <em>My best friend</em>
    (a) </h1> (b) </em> (c) </u> (d) </h3>
  21. 21.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="200">
    (a) tiger.jpg (b) A red kite (c) A tiger asleep (d) width
  22. 22.🌐 Which one colours code to help us? (a) a code editor (b) a web server (c) a web browser
  23. 23.True or false: a web server saves our .html files. (a) False (b) True
  24. 24.Which of these is a closing tag? (a) <li> (b) </title> (c) <p> (d) <b>
  25. 25.Which of these is true of a code editor? (a) is where we type code (b) has an address bar (c) stores a website’s files (d) shows pages from the web
  26. 26.💬 Why do coders write comments? (a) to leave notes (b) to add colour (c) to show pictures (d) to make links
  27. 27.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  28. 28.🔠 Which tag is used for the main title on a page? (a) <h1> (b) <h6> (c) <br> (d) <p>
  29. 29.💬 Which text will NOT show on the page?
    <p>Cricket is fun.</p>
    <p>Hello, world!</p>
    <!-- <p>The red kite</p> -->
    <p>Rain today</p>
    (a) Cricket is fun. (b) Hello, world! (c) Rain today (d) The red kite
  30. 30.💬 Which text will NOT show on the page?
    <!-- <p>Good morning!</p> -->
    <p>Our school trip</p>
    <p>The red kite</p>
    <p>Rain today</p>
    (a) Good morning! (b) Rain today (c) Our school trip (d) The red kite
  31. 31.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="300">
    (a) width (b) A red kite (c) tiger.jpg (d) A tiger asleep
  32. 32.Which of these has a closing tag? (a) <img> (b) <br> (c) <hr> (d) <h1>
  33. 33.🔢 In a basic web page file, which comes first: “</html>” or “<!DOCTYPE html>”? (a) </html> (b) <!DOCTYPE html>
  34. 34.🔠 Which heading shows the BIGGEST text: <h4>, <h1>, <h3> or <h6>? (a) <h6> (b) <h4> (c) <h3> (d) <h1>
  35. 35.📄 Can HTML on its own run a game loop? (a) Yes (b) No
  36. 36.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <br> (c) <ul> (d) <ol>
  37. 37.True or false: in <img>, width describes the picture. (a) True (b) False
  38. 38.Which of these is an empty tag? (a) <li> (b) <h1> (c) <ul> (d) <hr>
  39. 39.🏷️ Which is the closing tag for <u>? (a) <u/> (b) <u> (c) </u> (d) <\u>
  40. 40.True or false: <input> is an empty tag. (a) True (b) False

Answer key

  1. 3
  2. <a href="about.html">
  3. starts a new line
  4. in the body
  5. 200
  6. opens it in a new tab
  7. an opening tag
  8. as one space
  9. src
  10. My best friend
  11. </h2>
  12. in a new tab
  13. 50
  14. Easy snacks
  15. -->
  16. True
  17. About us
  18. a plain text editor
  19. 6
  20. </h1>
  21. A tiger asleep
  22. a code editor
  23. False
  24. </title>
  25. is where we type code
  26. to leave notes
  27. No
  28. <h1>
  29. The red kite
  30. Good morning!
  31. A tiger asleep
  32. <h1>
  33. <!DOCTYPE html>
  34. <h1>
  35. No
  36. <ol>
  37. False
  38. <hr>
  39. </u>
  40. True

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