← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 530 · 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 a closing tag? (a) <body> (b) <p> (c) </p> (d) <li>
  2. 2.🔠 How many headings are in this code?
    <h1>My pets</h1>
    <p>My best friend</p>
    <p>My best friend</p>
  3. 3.📝 How many paragraphs does this code make?
    <p>Fun facts</p>
    <p>Our school trip</p>
    <p>Fun facts</p>
    <p>I love mangoes.</p>
    <p>Fun facts</p>
  4. 4.🔗 Which code links to about.html? (a) <a alt="about.html"> (b) <a href="about.html"> (c) <link about.html> (d) <a src="about.html">
  5. 5.Which of these is true of a code editor? (a) turns HTML into a page (b) sends pages over the net (c) is where we type code (d) opens web pages for us
  6. 6.💬 Why do coders write comments? (a) to show pictures (b) to leave notes (c) to add colour (d) to make links
  7. 7.💬 How many paragraphs show on the page?
    <!-- <p>My best friend</p> -->
    <!-- <p>Rain today</p> -->
    <p>Fun facts</p>
    <!-- <p>My pets</p> -->
  8. 8.🔗 Which words do you click on?
    <a href="art.html">Contact us</a>
    (a) art.html (b) Visit the site (c) Contact us (d) href
  9. 9.📋 Which list tag goes inside ul or ol? (a) <li> (b) <ul> (c) <ol>
  10. 10.Which of these goes in the head? (a) <table> (b) <img> (c) <link rel="stylesheet"> (d) <a>
  11. 11.🌐 Which one saves our .html files? (a) a web server (b) a web browser (c) a code editor
  12. 12.True or false: in <img>, alt names the picture file. (a) True (b) False
  13. 13.Which of these is an opening tag? (a) <h1> (b) </body> (c) </li> (d) </b>
  14. 14.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
  15. 15.🏷️ Which is the closing tag for <em>? (a) <\em> (b) <em/> (c) <em> (d) </em>
  16. 16.🔠 Which heading shows the SMALLEST text: <h1>, <h5>, <h6> or <h2>? (a) <h6> (b) <h5> (c) <h2> (d) <h1>
  17. 17.🔠 Which heading shows the SMALLEST text: <h5>, <h1>, <h2> or <h3>? (a) <h3> (b) <h5> (c) <h2> (d) <h1>
  18. 18.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to make it bigger (c) to describe the image (d) to colour it
  19. 19.🖼️ Which attribute of <img> is read by screen readers? (a) alt (b) src (c) width (d) height
  20. 20.🔠 Which tag is used for the main title on a page? (a) <h6> (b) <h1> (c) <p> (d) <br>
  21. 21.🔤 In “HTML”, what does the L stand for? (a) Line (b) Laptop (c) Language (d) Link
  22. 22.🏷️ Is <title> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  23. 23.🌐 Which one shows line numbers? (a) a web server (b) a web browser (c) a code editor
  24. 24.💬 How many paragraphs show on the page?
    <p>The red kite</p>
    <p>Good morning!</p>
    <!-- <p>Cricket is fun.</p> -->
  25. 25.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as 5 spaces (b) as a new line (c) as one space (d) as a dot
  26. 26.True or false: <style> goes in the body. (a) True (b) False
  27. 27.🔗 Which attribute holds the address of a link? (a) href (b) src (c) id (d) alt
  28. 28.🔠 Which heading shows the BIGGEST text: <h6>, <h2>, <h1> or <h4>? (a) <h4> (b) <h2> (c) <h6> (d) <h1>
  29. 29.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="50">
  30. 30.🖼️ Which attribute of <img> tells which image to load? (a) src (b) height (c) alt (d) width
  31. 31.💬 How does an HTML comment start? (a) # (b) // (c) /* (d) <!--
  32. 32.🔠 How many headings are in this code?
    <h1>Good morning!</h1>
    <h2>My pets</h2>
    <p>Our school trip</p>
    <h3>My pets</h3>
  33. 33.💬 Which text will NOT show on the page?
    <p>My pets</p>
    <!-- <p>Cricket is fun.</p> -->
    <p>Rain today</p>
    (a) Cricket is fun. (b) My pets (c) Rain today
  34. 34.🔠 Which heading shows the SMALLEST text: <h3>, <h6>, <h2> or <h5>? (a) <h5> (b) <h3> (c) <h6> (d) <h2>
  35. 35.🏷️ Is </body> an opening tag or a closing tag? (a) a closing tag (b) an opening tag
  36. 36.📝 Does <input> 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>Good morning!</p>
    <p>Hello, world!</p>
    <!-- <p>Rain today</p> -->
    <!-- <p>Fun facts</p> -->
    <!-- <p>Cricket is fun.</p> -->
  38. 38.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <title> (c) <ul> (d) <style>
  39. 39.🔠 How many headings are in this code?
    <h1>I love mangoes.</h1>
    <h4>My pets</h4>
    <h2>Rain today</h2>
    <p>Fun facts</p>
    <h4>Cricket is fun.</h4>
  40. 40.Which of these is a closing tag? (a) </h1> (b) <h1> (c) <p> (d) <b>

Answer key

  1. </p>
  2. 1
  3. 5
  4. <a href="about.html">
  5. is where we type code
  6. to leave notes
  7. 1
  8. Contact us
  9. <li>
  10. <link rel="stylesheet">
  11. a code editor
  12. False
  13. <h1>
  14. <a>
  15. </em>
  16. <h6>
  17. <h5>
  18. to describe the image
  19. alt
  20. <h1>
  21. Language
  22. an opening tag
  23. a code editor
  24. 2
  25. as one space
  26. False
  27. href
  28. <h1>
  29. 50
  30. src
  31. <!--
  32. 3
  33. Cricket is fun.
  34. <h6>
  35. a closing tag
  36. an empty tag
  37. 2
  38. <ul>
  39. 4
  40. </h1>

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