← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 568 · 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>, alt tells which image to load. (a) False (b) True
  2. 2.📄 Can HTML on its own make bullet lists? (a) Yes (b) No
  3. 3.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) alt (d) src
  4. 4.📝 You type 5 spaces between two words in a <p>. How does the browser show them? (a) as a dot (b) as 5 spaces (c) as a new line (d) as one space
  5. 5.📝 What does <br> do? (a) adds a picture (b) makes text bold (c) makes a list (d) starts a new line
  6. 6.🔍 Which line is missing its closing tag?
    line 1: <i>Our school trip</i>
    line 2: <h1>My best friend
    line 3: <h2>The red kite</h2>
    (a) line 1 (b) line 3 (c) line 2
  7. 7.🔍 Which is the odd one out? (a) stores a website’s files (b) sends pages over the net (c) colours code to help us (d) hosts websites online
  8. 8.📄 Which part holds everything you see on the page? (a) the body (b) the title (c) the head (d) the doctype
  9. 9.📝 How many paragraphs does this code make?
    <p>My best friend</p>
    <p>The red kite</p>
    <p>Hello, world!</p>
  10. 10.🔍 One closing tag is missing. Which one?
    <h3>Hello, world!</h3>
    <small>Fun facts
    <i>Our school trip</i>
    (a) </p> (b) </h3> (c) </i> (d) </small>
  11. 11.True or false: HTML on its own cannot make tables. (a) False (b) True
  12. 12.True or false: in <img>, height sets how tall it is. (a) False (b) True
  13. 13.Which of these has a closing tag? (a) <li> (b) <input> (c) <hr> (d) <br>
  14. 14.🏷️ Is </body> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  15. 15.🔠 Which heading shows the BIGGEST text: <h5>, <h2>, <h6> or <h4>? (a) <h5> (b) <h2> (c) <h4> (d) <h6>
  16. 16.🔗 Which code links to about.html? (a) <a src="about.html"> (b) <link about.html> (c) <a alt="about.html"> (d) <a href="about.html">
  17. 17.🖼️ Why do we add alt text to an image? (a) to colour it (b) to load it faster (c) to make it bigger (d) to describe the image
  18. 18.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="kite.png" alt="A red kite" width="100">
    (a) kite.png (b) Map of India (c) width (d) A red kite
  19. 19.📝 How many paragraphs does this code make?
    <p>Our school trip</p>
    <h2>Fun facts</h2>
    <h2>The red kite</h2>
    <p>Good morning!</p>
  20. 20.Which of these has a closing tag? (a) <ul> (b) <img> (c) <input> (d) <br>
  21. 21.🖼️ Which attribute of <img> shows if the image fails? (a) src (b) height (c) width (d) alt
  22. 22.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  23. 23.📋 Which list tag is one item of a list? (a) <ul> (b) <ol> (c) <li>
  24. 24.🌐 Which one stores a website’s files? (a) a code editor (b) a web browser (c) a web server
  25. 25.📄 What is the first line of an HTML5 page? (a) <!DOCTYPE html> (b) <body> (c) <html> (d) <head>
  26. 26.📝 On how many lines does the browser show this paragraph?
    <p>Roses are red<br>Rivers flow<br>Sky is blue<br>Kites fly high<br>Birds sing</p>
  27. 27.📄 Can HTML on its own add pictures to a page? (a) Yes (b) No
  28. 28.📝 What does <p> make? (a) a link (b) a picture (c) a paragraph (d) a table
  29. 29.🔗 What does target="_blank" do to a link? (a) opens it in a new tab (b) makes it bold (c) makes it blank (d) hides the link
  30. 30.🔠 Which heading shows the BIGGEST text: <h1>, <h5>, <h6> or <h3>? (a) <h3> (b) <h6> (c) <h1> (d) <h5>
  31. 31.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>Match report</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) index.html (b) My Hobbies (c) Mars is red. (d) Match report
  32. 32.📋 Does this list show bullets or numbers?
    <ul>
      <li>Litchi</li>
      <li>Jamun</li>
      <li>Mango</li>
    </ul>
    (a) numbers (b) bullets
  33. 33.🔗 Which words do you click on?
    <a href="maths.html">Contact us</a>
    (a) Visit the site (b) maths.html (c) href (d) Contact us
  34. 34.💬 Which text will NOT show on the page?
    <!-- <p>My pets</p> -->
    <p>I love mangoes.</p>
    <p>Cricket is fun.</p>
    (a) I love mangoes. (b) Cricket is fun. (c) My pets
  35. 35.💬 How many paragraphs show on the page?
    <!-- <p>Good morning!</p> -->
    <p>The red kite</p>
    <p>My pets</p>
  36. 36.🔠 Which tag is the least important heading? (a) <p> (b) <h1> (c) <h6> (d) <h3>
  37. 37.📝 How many paragraphs does this code make?
    <p>Rain today</p>
    <p>My pets</p>
    <h2>Cricket is fun.</h2>
    <p>Our school trip</p>
  38. 38.🔢 In a basic web page file, which comes FIRST? (a) <html> (b) </body> (c) </head> (d) <!DOCTYPE html>
  39. 39.📋 What number does the browser show next to “Orange”?
    <ol start="8">
      <li>Guava</li>
      <li>Orange</li>
      <li>Banana</li>
    </ol>
  40. 40.True or false: <link rel="stylesheet"> goes in the head. (a) True (b) False

Answer key

  1. False
  2. Yes
  3. height
  4. as one space
  5. starts a new line
  6. line 2
  7. colours code to help us
  8. the body
  9. 3
  10. </small>
  11. False
  12. True
  13. <li>
  14. a closing tag
  15. <h2>
  16. <a href="about.html">
  17. to describe the image
  18. A red kite
  19. 2
  20. <ul>
  21. alt
  22. No
  23. <li>
  24. a web server
  25. <!DOCTYPE html>
  26. 5
  27. Yes
  28. a paragraph
  29. opens it in a new tab
  30. <h1>
  31. My Hobbies
  32. bullets
  33. Contact us
  34. My pets
  35. 2
  36. <h6>
  37. 3
  38. <!DOCTYPE html>
  39. 9
  40. True

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