← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 347 · 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 attribute of <img> sets how tall it is? (a) src (b) width (c) alt (d) height
  2. 2.🖼️ Why do we add alt text to an image? (a) to colour it (b) to make it bigger (c) to load it faster (d) to describe the image
  3. 3.Which of these is true of a code editor? (a) shows pages from the web (b) has an address bar (c) saves our .html files (d) sends pages over the net
  4. 4.📋 Which list shows the steps of a recipe best? (a) <ul> (b) <br> (c) <hr> (d) <ol>
  5. 5.Which of these is true of a web browser? (a) hosts websites online (b) colours code to help us (c) stores a website’s files (d) opens web pages for us
  6. 6.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>My Hobbies</title>
    </head>
    <body>
      <h1>My drawings</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Mars is red. (b) index.html (c) My drawings (d) My Hobbies
  7. 7.🔗 Where does this link open?
    <a href="quiz.html">Contact us</a>
    (a) in the same tab (b) in a new tab
  8. 8.🔍 One closing tag is missing. Which one?
    <small>Our school trip</small>
    <h3>Hello, world!</h3>
    <h2>I love mangoes.
    (a) </h3> (b) </small> (c) </h1> (d) </h2>
  9. 9.🏷️ Is <h1> an opening tag or a closing tag? (a) an opening tag (b) a closing tag
  10. 10.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="400">
  11. 11.💬 How many paragraphs show on the page?
    <!-- <p>Fun facts</p> -->
    <!-- <p>Good morning!</p> -->
    <p>Cricket is fun.</p>
  12. 12.🔍 One closing tag is missing. Which one?
    <small>My best friend</small>
    <h2>I love mangoes.
    <b>Hello, world!</b>
    (a) </em> (b) </h2> (c) </small> (d) </b>
  13. 13.🔠 How many headings are in this code?
    <h1>Good morning!</h1>
    <h2>Hello, world!</h2>
    <p>Rain today</p>
  14. 14.💬 Which text will NOT show on the page?
    <p>Cricket is fun.</p>
    <p>Fun facts</p>
    <!-- <p>My pets</p> -->
    (a) Cricket is fun. (b) My pets (c) Fun facts
  15. 15.True or false: in <img>, alt tells which image to load. (a) True (b) False
  16. 16.🔠 How many <h1> headings should a page usually have? (a) 10 (b) 3 (c) 6 (d) 1
  17. 17.📄 Can HTML on its own make headings? (a) Yes (b) No
  18. 18.🏷️ Every HTML tag starts with which sign? (a) [ (b) { (c) ( (d) <
  19. 19.💬 How does an HTML comment end? (a) --> (b) >> (c) */ (d) //
  20. 20.📝 Does <b> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  21. 21.🖼️ Which attribute of <img> shows if the image fails? (a) width (b) height (c) alt (d) src
  22. 22.💬 How many paragraphs show on the page?
    <!-- <p>My pets</p> -->
    <!-- <p>My best friend</p> -->
    <!-- <p>Fun facts</p> -->
    <p>I love mangoes.</p>
  23. 23.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Riya’s Recipes</title>
    </head>
    <body>
      <h1>Easy snacks</h1>
      <p>Thanks for visiting.</p>
    </body>
    </html>
    (a) index.html (b) Thanks for visiting. (c) Riya’s Recipes (d) Easy snacks
  24. 24.True or false: <ul> goes in the head. (a) True (b) False
  25. 25.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a dot . (c) a hash # (d) a slash /
  26. 26.💬 How many paragraphs show on the page?
    <!-- <p>Rain today</p> -->
    <p>Fun facts</p>
    <p>The red kite</p>
  27. 27.True or false: <hr> is an empty tag. (a) False (b) True
  28. 28.True or false: HTML on its own can pick a random number. (a) True (b) False
  29. 29.🔠 Which heading shows the BIGGEST text: <h1>, <h6>, <h4> or <h3>? (a) <h4> (b) <h6> (c) <h3> (d) <h1>
  30. 30.True or false: <a> goes in the head. (a) False (b) True
  31. 31.🔠 How many headings are in this code?
    <h1>The red kite</h1>
    <h4>The red kite</h4>
    <h2>Fun facts</h2>
    <p>Our school trip</p>
  32. 32.True or false: <meta charset="utf-8"> goes in the head. (a) True (b) False
  33. 33.🔠 Are headings shown in bold by default? (a) Yes (b) No
  34. 34.🔗 Which words do you click on?
    <a href="games.html">Take the quiz</a>
    (a) Take the quiz (b) href (c) Play games (d) games.html
  35. 35.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="150">
    (a) A tiger asleep (b) width (c) A red kite (d) tiger.jpg
  36. 36.🔢 In a basic web page file, which comes first: “</body>” or “<html>”? (a) <html> (b) </body>
  37. 37.💬 How many paragraphs show on the page?
    <!-- <p>Our school trip</p> -->
    <p>Rain today</p>
    <!-- <p>The red kite</p> -->
  38. 38.📋 Does this list show bullets or numbers?
    <ul>
      <li>Banana</li>
      <li>Guava</li>
      <li>Jamun</li>
    </ul>
    (a) numbers (b) bullets
  39. 39.💾 A web page file usually ends with which extension? (a) .mp3 (b) .png (c) .html (d) .txt
  40. 40.🔠 Which heading shows the BIGGEST text: <h3>, <h4>, <h5> or <h1>? (a) <h3> (b) <h4> (c) <h5> (d) <h1>

Answer key

  1. height
  2. to describe the image
  3. saves our .html files
  4. <ol>
  5. opens web pages for us
  6. My Hobbies
  7. in the same tab
  8. </h2>
  9. an opening tag
  10. 400
  11. 1
  12. </h2>
  13. 2
  14. My pets
  15. False
  16. 1
  17. Yes
  18. <
  19. -->
  20. has a closing tag
  21. alt
  22. 1
  23. Riya’s Recipes
  24. False
  25. a slash /
  26. 2
  27. True
  28. False
  29. <h1>
  30. False
  31. 3
  32. True
  33. Yes
  34. Take the quiz
  35. A tiger asleep
  36. <html>
  37. 1
  38. bullets
  39. .html
  40. <h1>

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