← HTML basics test lesson New set →

HTML Worksheet: Practice Test

HTML and CSS lesson 10: HTML basics test · Set 426 · 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 goes in the head? (a) <img> (b) <title> (c) <ul> (d) <p>
  2. 2.📄 What is the first line of an HTML5 page? (a) <body> (b) <html> (c) <head> (d) <!DOCTYPE html>
  3. 3.🔡 Are HTML tag names usually written in small letters? (a) Yes (b) No
  4. 4.📄 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) Welcome! (b) Try this poha. (c) index.html (d) My Hobbies
  5. 5.🔠 Which heading shows the SMALLEST text: <h1>, <h6>, <h2> or <h3>? (a) <h3> (b) <h1> (c) <h6> (d) <h2>
  6. 6.🔢 In a basic web page file, which comes first: “</head>” or “<html>”? (a) <html> (b) </head>
  7. 7.🔍 One closing tag is missing. Which one?
    <strong>Fun facts
    <h1>The red kite</h1>
    <em>Rain today</em>
    (a) </h1> (b) </em> (c) </h2> (d) </strong>
  8. 8.🏷️ What does a closing tag have that an opening tag does not? (a) a dollar $ (b) a hash # (c) a slash / (d) a dot .
  9. 9.📛 In <a href="x.html">, what is href? (a) a closing tag (b) an attribute (c) a comment (d) an element name
  10. 10.📝 On how many lines does the browser show this paragraph?
    <p>Rivers flow<br>Roses are red<br>Stars shine<br>Kites fly high<br>Birds sing</p>
  11. 11.Which of these goes in the body? (a) <meta charset="utf-8"> (b) <table> (c) <link rel="stylesheet"> (d) <style>
  12. 12.📄 Where does <link rel="stylesheet"> go: in the head or in the body? (a) in the head (b) in the body
  13. 13.📋 How many items does this list show?
    <ol>
      <li>Orange</li>
      <li>Banana</li>
      <li>Jamun</li>
    </ol>
  14. 14.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="dog.jpg" alt="A happy dog" width="200">
    (a) dog.jpg (b) The full moon (c) A happy dog (d) width
  15. 15.Which of these has a closing tag? (a) <br> (b) <hr> (c) <img> (d) <title>
  16. 16.💬 How does an HTML comment end? (a) // (b) */ (c) >> (d) -->
  17. 17.💬 Which text will NOT show on the page?
    <p>Our school trip</p>
    <p>Fun facts</p>
    <!-- <p>My pets</p> -->
    (a) Fun facts (b) My pets (c) Our school trip
  18. 18.🔗 Which words do you click on?
    <a href="about.html">School news</a>
    (a) href (b) School news (c) Take the quiz (d) about.html
  19. 19.💬 Why do coders write comments? (a) to make links (b) to add colour (c) to show pictures (d) to leave notes
  20. 20.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="400">
    (a) kite.png (b) tiger.jpg (c) map.png (d) A tiger asleep
  21. 21.🌐 Which one shows line numbers? (a) a web server (b) a code editor (c) a web browser
  22. 22.📝 Does <p> have a closing tag, or is it an empty tag? (a) an empty tag (b) has a closing tag
  23. 23.📄 Where does <table> go: in the head or in the body? (a) in the body (b) in the head
  24. 24.🖼️ Which attribute of <img> shows if the image fails? (a) alt (b) height (c) width (d) src
  25. 25.📄 Where does <p> go: in the head or in the body? (a) in the head (b) in the body
  26. 26.🖼️ Which picture file does the browser load?
    <img src="map.png" alt="Map of India" width="150">
    (a) cake.jpg (b) map.png (c) Map of India (d) dog.jpg
  27. 27.📄 What does the browser tab show for this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Class 7 Blog</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) All about me (b) Mars is red. (c) Class 7 Blog (d) index.html
  28. 28.True or false: in <img>, alt names the picture file. (a) False (b) True
  29. 29.🔗 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
  30. 30.📋 Which list tag shows 1, 2, 3 numbers? (a) <li> (b) <ol> (c) <ul>
  31. 31.🔗 Which tag makes a clickable link? (a) <a> (b) <p> (c) <link> (d) <img>
  32. 32.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="250">
  33. 33.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Cricket Club</title>
    </head>
    <body>
      <h1>All about me</h1>
      <p>Mars is red.</p>
    </body>
    </html>
    (a) Mars is red. (b) Cricket Club (c) All about me (d) body
  34. 34.📄 What is the big heading shown on this page?
    <!DOCTYPE html>
    <html>
    <head>
      <title>Art Gallery</title>
    </head>
    <body>
      <h1>Welcome!</h1>
      <p>Here is my best one.</p>
    </body>
    </html>
    (a) Welcome! (b) Here is my best one. (c) Art Gallery (d) body
  35. 35.Which of these is true of a web server? (a) turns HTML into a page (b) hosts websites online (c) saves our .html files (d) shows pages from the web
  36. 36.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) alt (c) width (d) height
  37. 37.🔠 Which tag is the least important heading? (a) <h3> (b) <h6> (c) <h1> (d) <p>
  38. 38.📋 Does this list show bullets or numbers?
    <ul>
      <li>Mango</li>
      <li>Banana</li>
      <li>Orange</li>
    </ul>
    (a) numbers (b) bullets
  39. 39.🔗 Which code links to about.html? (a) <link about.html> (b) <a href="about.html"> (c) <a alt="about.html"> (d) <a src="about.html">
  40. 40.True or false: <input> has a closing tag. (a) True (b) False

Answer key

  1. <title>
  2. <!DOCTYPE html>
  3. Yes
  4. My Hobbies
  5. <h6>
  6. <html>
  7. </strong>
  8. a slash /
  9. an attribute
  10. 5
  11. <table>
  12. in the head
  13. 3
  14. A happy dog
  15. <title>
  16. -->
  17. My pets
  18. School news
  19. to leave notes
  20. tiger.jpg
  21. a code editor
  22. has a closing tag
  23. in the body
  24. alt
  25. in the body
  26. map.png
  27. Class 7 Blog
  28. False
  29. opens it in a new tab
  30. <ol>
  31. <a>
  32. 250
  33. All about me
  34. Welcome!
  35. hosts websites online
  36. width
  37. <h6>
  38. bullets
  39. <a href="about.html">
  40. False

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