← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 988 · 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.Which of these is an opening tag? (a) </b> (b) </li> (c) </h1> (d) <p>
  2. 2.🏷️ Which is the closing tag for <h1>? (a) <h1> (b) </h1> (c) <\h1> (d) <h1/>
  3. 3.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Kites fly high</p>
  4. 4.True or false: a code editor is where we type code. (a) False (b) True
  5. 5.🔢 In a basic web page file, which comes LAST? (a) <!DOCTYPE html> (b) <body> (c) </body> (d) </html>
  6. 6.🔗 Which address opens when you click this link?
    <a href="quiz.html">School news</a>
    (a) School news (b) about.html (c) games.html (d) quiz.html
  7. 7.📛 In <a href="x.html">, what is href? (a) a comment (b) an element name (c) an attribute (d) a closing tag
  8. 8.Which of these is an empty tag? (a) <title> (b) <h1> (c) <p> (d) <input>
  9. 9.🔠 How many headings are in this code?
    <h1>Rain today</h1>
    <p>Rain today</p>
    <p>Cricket is fun.</p>
    <h2>Fun facts</h2>
  10. 10.🏷️ Every HTML tag starts with which sign? (a) < (b) { (c) [ (d) (
  11. 11.📄 Which part holds everything you see on the page? (a) the body (b) the title (c) the head (d) the doctype
  12. 12.🖼️ How many pixels wide is the picture drawn?
    <img src="dog.jpg" alt="A happy dog" width="200">
  13. 13.True or false: a web browser turns HTML into a page. (a) False (b) True
  14. 14.True or false: <a> goes in the body. (a) False (b) True
  15. 15.True or false: in <img>, src is read by screen readers. (a) False (b) True
  16. 16.💬 Can anyone read your comments by viewing the page source? (a) No (b) Yes
  17. 17.🖼️ Which attribute of <img> shows if the image fails? (a) height (b) width (c) alt (d) src
  18. 18.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Space Facts</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Space Facts (b) Easy snacks (c) index.html (d) Try this poha.
  19. 19.🔠 Which heading shows the SMALLEST text: <h2>, <h5>, <h1> or <h6>? (a) <h2> (b) <h5> (c) <h6> (d) <h1>
  20. 20.Which of these is true of a code editor? (a) hosts websites online (b) shows pages from the web (c) turns HTML into a page (d) is where we type code
  21. 21.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="200">
    (a) A red kite (b) width (c) tiger.jpg (d) A tiger asleep
  22. 22.Which of these is a closing tag? (a) <title> (b) <p> (c) <b> (d) </body>
  23. 23.🔢 In a basic web page file, which comes first: “<html>” or “<body>”? (a) <body> (b) <html>
  24. 24.True or false: <li> is one item of a list. (a) True (b) False
  25. 25.🔠 How many headings are in this code?
    <h1>Rain today</h1>
    <h2>Good morning!</h2>
    <p>Our school trip</p>
  26. 26.📋 Which list tag shows 1, 2, 3 numbers? (a) <li> (b) <ol> (c) <ul>
  27. 27.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="350">
  28. 28.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  29. 29.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="50">
  30. 30.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="map.png" alt="Map of India" width="150">
    (a) map.png (b) Birthday cake (c) Map of India (d) width
  31. 31.📋 Which list suits a shopping list in any order? (a) <br> (b) <ol> (c) <ul> (d) <hr>
  32. 32.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <h2>Good morning!</h2>
    <h2>Cricket is fun.</h2>
  33. 33.📋 Which tag goes around each item of a list? (a) <p> (b) <li> (c) <ol> (d) <ul>
  34. 34.True or false: in <img>, src names the picture file. (a) False (b) True
  35. 35.🌐 Which one turns HTML into a page? (a) a web browser (b) a web server (c) a code editor
  36. 36.🔍 Which line is missing its closing tag?
    line 1: <b>Fun facts
    line 2: <small>My pets</small>
    line 3: <h2>The red kite</h2>
    (a) line 1 (b) line 3 (c) line 2
  37. 37.Which of these goes in the body? (a) <table> (b) <title> (c) <link rel="stylesheet"> (d) <style>
  38. 38.🖼️ How many pixels wide is the picture drawn?
    <img src="dog.jpg" alt="A happy dog" width="100">
  39. 39.🏷️ Is <li> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  40. 40.Which of these is a closing tag? (a) </li> (b) <b> (c) <body> (d) <h1>

Answer key

  1. <p>
  2. </h1>
  3. 2
  4. True
  5. </html>
  6. quiz.html
  7. an attribute
  8. <input>
  9. 2
  10. <
  11. the body
  12. 200
  13. True
  14. True
  15. False
  16. Yes
  17. alt
  18. Space Facts
  19. <h6>
  20. is where we type code
  21. A tiger asleep
  22. </body>
  23. <html>
  24. True
  25. 2
  26. <ol>
  27. 350
  28. an opening tag
  29. 50
  30. Map of India
  31. <ul>
  32. 1
  33. <li>
  34. True
  35. a web browser
  36. line 1
  37. <table>
  38. 100
  39. an opening tag
  40. </li>

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