← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 395 · 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.True or false: <meta charset="utf-8"> goes in the body. (a) True (b) False
  2. 2.🔗 Which attribute holds the address of a link? (a) src (b) href (c) id (d) alt
  3. 3.📛 In <a href="x.html">, what is href? (a) an element name (b) a closing tag (c) a comment (d) an attribute
  4. 4.📄 Can HTML on its own make a form? (a) Yes (b) No
  5. 5.🏷️ Which is the closing tag for <strong>? (a) <\strong> (b) <strong/> (c) <strong> (d) </strong>
  6. 6.📝 On how many lines does the browser show this paragraph?
    <p>Stars shine<br>Sky is blue</p>
  7. 7.📄 Can HTML on its own show paragraphs? (a) No (b) Yes
  8. 8.Which of these goes in the body? (a) <link rel="stylesheet"> (b) <title> (c) <meta charset="utf-8"> (d) <a>
  9. 9.True or false: in <img>, alt shows if the image fails. (a) False (b) True
  10. 10.Which of these is an empty tag? (a) <b> (b) <img> (c) <ul> (d) <li>
  11. 11.🔠 How many headings are in this code?
    <h1>Rain today</h1>
    <p>Our school trip</p>
    <h3>Cricket is fun.</h3>
    <p>I love mangoes.</p>
    <h4>Good morning!</h4>
  12. 12.💬 How does an HTML comment end? (a) // (b) */ (c) >> (d) -->
  13. 13.Which of these is true of a web server? (a) opens web pages for us (b) hosts websites online (c) saves our .html files (d) shows line numbers
  14. 14.💬 How many paragraphs show on the page?
    <!-- <p>Cricket is fun.</p> -->
    <p>My pets</p>
    <!-- <p>Fun facts</p> -->
  15. 15.🌐 Which one has an address bar? (a) a web server (b) a code editor (c) a web browser
  16. 16.Which of these is an opening tag? (a) </title> (b) <h1> (c) </p> (d) </li>
  17. 17.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) width (c) height (d) src
  18. 18.🧱 HTML gives a web page its ___. (a) sound (b) speed (c) structure (d) colours
  19. 19.💬 Which text will NOT show on the page?
    <!-- <p>Rain today</p> -->
    <p>I love mangoes.</p>
    <p>Fun facts</p>
    <p>Our school trip</p>
    (a) I love mangoes. (b) Fun facts (c) Rain today (d) Our school trip
  20. 20.🔠 How many headings are in this code?
    <h1>I love mangoes.</h1>
    <h2>The red kite</h2>
    <p>Rain today</p>
    <h4>Hello, world!</h4>
    <h2>The red kite</h2>
  21. 21.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  22. 22.Which of these is an empty tag? (a) <li> (b) <b> (c) <hr> (d) <h1>
  23. 23.🏷️ Which is the closing tag for <u>? (a) <u/> (b) <u> (c) <\u> (d) </u>
  24. 24.📋 What number does the browser show next to “Orange”?
    <ol>
      <li>Jamun</li>
      <li>Grapes</li>
      <li>Orange</li>
    </ol>
  25. 25.🔠 How many headings are in this code?
    <h1>Hello, world!</h1>
    <h3>Cricket is fun.</h3>
    <p>My pets</p>
  26. 26.🔗 Where does this link open?
    <a href="games.html" target="_blank">Play games</a>
    (a) in a new tab (b) in the same tab
  27. 27.🔠 How many <h1> headings should a page usually have? (a) 6 (b) 3 (c) 10 (d) 1
  28. 28.🔠 Which heading shows the SMALLEST text: <h4>, <h2>, <h5> or <h6>? (a) <h5> (b) <h4> (c) <h6> (d) <h2>
  29. 29.📋 Which list tag lists steps in order? (a) <ul> (b) <ol> (c) <li>
  30. 30.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="350">
  31. 31.🖼️ How many pixels wide is the picture drawn?
    <img src="tiger.jpg" alt="A tiger asleep" width="300">
  32. 32.True or false: in <img>, src tells which image to load. (a) False (b) True
  33. 33.🔠 How many headings are in this code?
    <h1>Our school trip</h1>
    <h4>The red kite</h4>
    <p>I love mangoes.</p>
    <p>Fun facts</p>
    <h2>Fun facts</h2>
  34. 34.🔍 Which line is missing its closing tag?
    line 1: <b>The red kite</b>
    line 2: <u>I love mangoes.</u>
    line 3: <small>My best friend
    (a) line 1 (b) line 3 (c) line 2
  35. 35.🔗 Which words do you click on?
    <a href="contact.html">Play games</a>
    (a) contact.html (b) About us (c) Play games (d) href
  36. 36.Which of these is true of a web browser? (a) hosts websites online (b) is where we type code (c) stores a website’s files (d) shows pages from the web
  37. 37.🔗 Which tag makes a clickable link? (a) <link> (b) <img> (c) <p> (d) <a>
  38. 38.🔠 Which heading shows the SMALLEST text: <h1>, <h4>, <h3> or <h2>? (a) <h2> (b) <h4> (c) <h3> (d) <h1>
  39. 39.💬 How does an HTML comment start? (a) // (b) /* (c) <!-- (d) #
  40. 40.🔍 One closing tag is missing. Which one?
    <h2>Hello, world!</h2>
    <u>The red kite
    <h3>Our school trip</h3>
    (a) </h1> (b) </u> (c) </h2> (d) </h3>

Answer key

  1. False
  2. href
  3. an attribute
  4. Yes
  5. </strong>
  6. 2
  7. Yes
  8. <a>
  9. True
  10. <img>
  11. 3
  12. -->
  13. hosts websites online
  14. 1
  15. a web browser
  16. <h1>
  17. width
  18. structure
  19. Rain today
  20. 4
  21. No
  22. <hr>
  23. </u>
  24. 3
  25. 2
  26. in a new tab
  27. 1
  28. <h6>
  29. <ol>
  30. 350
  31. 300
  32. True
  33. 3
  34. line 3
  35. Play games
  36. shows pages from the web
  37. <a>
  38. <h4>
  39. <!--
  40. </u>

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