← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 876 · 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: in <img>, width shows if the image fails. (a) True (b) False
  2. 2.📄 Where does <p> go: in the head or in the body? (a) in the body (b) in the head
  3. 3.📝 What does <p> make? (a) a table (b) a link (c) a paragraph (d) a picture
  4. 4.💬 How many paragraphs show on the page?
    <p>Hello, world!</p>
    <!-- <p>Good morning!</p> -->
    <p>The red kite</p>
  5. 5.🖼️ Which tag puts a picture on a page? (a) <p> (b) <img> (c) <a> (d) <pic>
  6. 6.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) height (c) width (d) alt
  7. 7.📝 On how many lines does the browser show this paragraph?
    <p>Birds sing<br>Rivers flow<br>Roses are red<br>Stars shine</p>
  8. 8.🔗 What does target="_blank" do to a link? (a) makes it bold (b) hides the link (c) opens it in a new tab (d) makes it blank
  9. 9.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <p>My best friend</p>
    <p>Fun facts</p>
  10. 10.🔠 How many headings are in this code?
    <h1>The red kite</h1>
    <h3>Our school trip</h3>
    <p>Fun facts</p>
    <p>My pets</p>
    <h2>The red kite</h2>
  11. 11.📋 Which list shows the steps of a recipe best? (a) <hr> (b) <ol> (c) <ul> (d) <br>
  12. 12.Which of these is a closing tag? (a) <b> (b) </li> (c) <body> (d) <h1>
  13. 13.🔗 Where does this link open?
    <a href="quiz.html" target="_blank">About us</a>
    (a) in a new tab (b) in the same tab
  14. 14.💬 How does an HTML comment start? (a) # (b) /* (c) // (d) <!--
  15. 15.🧩 An opening tag + content + a closing tag together make an ___. (a) editor (b) address (c) element (d) attribute
  16. 16.🔠 Which heading shows the SMALLEST text: <h1>, <h4>, <h5> or <h3>? (a) <h4> (b) <h5> (c) <h3> (d) <h1>
  17. 17.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <p>I love mangoes.</p>
    <p>Cricket is fun.</p>
  18. 18.🔠 How many headings are in this code?
    <h1>The red kite</h1>
    <h4>My best friend</h4>
    <h2>I love mangoes.</h2>
    <h2>My pets</h2>
    <p>Our school trip</p>
  19. 19.📋 Which list tag shows bullet points? (a) <ul> (b) <li> (c) <ol>
  20. 20.Which of these goes in the head? (a) <title> (b) <a> (c) <p> (d) <h1>
  21. 21.True or false: HTML on its own can make tables. (a) True (b) False
  22. 22.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
  23. 23.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Try this poha.</p>
    </body>
    </html>
    (a) Try this poha. (b) index.html (c) My Hobbies (d) Welcome!
  24. 24.🔗 Which attribute holds the address of a link? (a) src (b) alt (c) id (d) href
  25. 25.📄 What is the first line of an HTML5 page? (a) <body> (b) <html> (c) <!DOCTYPE html> (d) <head>
  26. 26.Which of these goes in the head? (a) <a> (b) <table> (c) <img> (d) <link rel="stylesheet">
  27. 27.🔍 One closing tag is missing. Which one?
    <u>Our school trip
    <h1>My best friend</h1>
    <i>I love mangoes.</i>
    (a) </p> (b) </u> (c) </i> (d) </h1>
  28. 28.💬 Why do coders write comments? (a) to show pictures (b) to add colour (c) to make links (d) to leave notes
  29. 29.Which of these is an opening tag? (a) <b> (b) </body> (c) </p> (d) </h1>
  30. 30.📋 Does this list show bullets or numbers?
    <ul>
      <li>Guava</li>
      <li>Jamun</li>
    </ul>
    (a) bullets (b) numbers
  31. 31.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as one space (b) as a new line (c) as a dot (d) as 5 spaces
  32. 32.🔍 Which line is missing its closing tag?
    line 1: <p>Hello, world!
    line 2: <h1>Fun facts</h1>
    line 3: <h3>Good morning!</h3>
    (a) line 3 (b) line 2 (c) line 1
  33. 33.📝 On how many lines does the browser show this paragraph?
    <p>Sky is blue<br>Roses are red<br>Rivers flow</p>
  34. 34.🔗 Which address opens when you click this link?
    <a href="news.html">Contact us</a>
    (a) Contact us (b) games.html (c) news.html (d) quiz.html
  35. 35.True or false: a web server sends pages over the net. (a) False (b) True
  36. 36.Which of these is true of a web server? (a) saves our .html files (b) answers page requests (c) turns HTML into a page (d) shows pages from the web
  37. 37.💾 A web page file usually ends with which extension? (a) .html (b) .png (c) .txt (d) .mp3
  38. 38.🔍 One closing tag is missing. Which one?
    <strong>My pets</strong>
    <em>I love mangoes.
    <h2>Good morning!</h2>
    (a) </small> (b) </strong> (c) </em> (d) </h2>
  39. 39.📄 Where does <ul> go: in the head or in the body? (a) in the head (b) in the body
  40. 40.🔠 How many headings are in this code?
    <h1>Cricket is fun.</h1>
    <p>Our school trip</p>
    <p>Hello, world!</p>
    <p>My pets</p>
    <p>The red kite</p>

Answer key

  1. False
  2. in the body
  3. a paragraph
  4. 2
  5. <img>
  6. width
  7. 4
  8. opens it in a new tab
  9. 2
  10. 3
  11. <ol>
  12. </li>
  13. in a new tab
  14. <!--
  15. element
  16. <h5>
  17. 3
  18. 4
  19. <ul>
  20. <title>
  21. True
  22. in the head
  23. My Hobbies
  24. href
  25. <!DOCTYPE html>
  26. <link rel="stylesheet">
  27. </u>
  28. to leave notes
  29. <b>
  30. bullets
  31. as one space
  32. line 1
  33. 3
  34. news.html
  35. True
  36. answers page requests
  37. .html
  38. </em>
  39. in the body
  40. 1

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