← Images with img, src and alt lesson New set →

HTML Worksheet: Images and Alt Text

HTML and CSS lesson 7: Images with img, src and alt · Set 48 · 40 questions
TalentJR

Code tip (File and words): <img src="file.jpg" alt="what it shows" width="200"> — no closing tag. src = which file to load; alt = words describing it; width / height = size in pixels. If the picture fails, the browser shows the alt text; screen readers read it aloud.

NameDateTime takenScore ___ / 40
  1. 1.🖼️ Does <img> need a closing tag? (a) Yes (b) No
  2. 2.🖼️ Why do we add alt text to an image? (a) to load it faster (b) to describe the image (c) to make it bigger (d) to colour it
  3. 3.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="300">
  4. 4.True or false: in <img>, src tells which image to load. (a) False (b) True
  5. 5.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="100">
  6. 6.True or false: in <img>, src shows if the image fails. (a) True (b) False
  7. 7.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="bus.jpg" alt="Our school bus" width="250">
    (a) width (b) An old fort (c) bus.jpg (d) Our school bus
  8. 8.🖼️ How many pixels wide is the picture drawn?
    <img src="dog.jpg" alt="A happy dog" width="100">
  9. 9.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="300">
    (a) map.png (b) kite.png (c) A red kite (d) cake.jpg
  10. 10.True or false: in <img>, src names the picture file. (a) False (b) True
  11. 11.🖼️ Which attribute of <img> describes the picture? (a) width (b) height (c) src (d) alt
  12. 12.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="cake.jpg" alt="Birthday cake" width="100">
    (a) width (b) cake.jpg (c) Birthday cake (d) A happy dog
  13. 13.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="350">
    (a) map.png (b) cake.jpg (c) A red kite (d) kite.png
  14. 14.🖼️ How many pixels wide is the picture drawn?
    <img src="cake.jpg" alt="Birthday cake" width="100">
  15. 15.True or false: in <img>, width tells which image to load. (a) True (b) False
  16. 16.🖼️ Which picture file does the browser load?
    <img src="cake.jpg" alt="Birthday cake" width="250">
    (a) dog.jpg (b) Birthday cake (c) moon.png (d) cake.jpg
  17. 17.🖼️ Which attribute of <img> sets how tall it is? (a) src (b) alt (c) width (d) height
  18. 18.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="250">
    (a) A tiger asleep (b) width (c) An old fort (d) fort.jpg
  19. 19.🖼️ How many pixels wide is the picture drawn?
    <img src="moon.png" alt="The full moon" width="50">
  20. 20.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="200">
    (a) width (b) A red kite (c) A tiger asleep (d) tiger.jpg
  21. 21.True or false: in <img>, width names the picture file. (a) True (b) False
  22. 22.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) width (c) height (d) alt
  23. 23.True or false: in <img>, width sets how wide it is. (a) False (b) True
  24. 24.🖼️ Which attribute of <img> shows if the image fails? (a) width (b) height (c) src (d) alt
  25. 25.True or false: in <img>, src sets how tall it is. (a) True (b) False
  26. 26.True or false: in <img>, alt shows if the image fails. (a) True (b) False
  27. 27.True or false: in <img>, alt describes the picture. (a) True (b) False
  28. 28.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="350">
    (a) tiger.jpg (b) A tiger asleep (c) width (d) A red kite
  29. 29.🖼️ Which attribute of <img> names the picture file? (a) alt (b) src (c) height (d) width
  30. 30.True or false: in <img>, width is read by screen readers. (a) False (b) True
  31. 31.🖼️ Which picture file does the browser load?
    <img src="moon.png" alt="The full moon" width="400">
    (a) bus.jpg (b) fort.jpg (c) The full moon (d) moon.png
  32. 32.🖼️ Which tag puts a picture on a page? (a) <img> (b) <pic> (c) <a> (d) <p>
  33. 33.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="350">
    (a) An old fort (b) A tiger asleep (c) fort.jpg (d) width
  34. 34.True or false: in <img>, height tells which image to load. (a) True (b) False
  35. 35.🖼️ How many pixels wide is the picture drawn?
    <img src="cake.jpg" alt="Birthday cake" width="400">
  36. 36.🖼️ Which picture file does the browser load?
    <img src="bus.jpg" alt="Our school bus" width="350">
    (a) Our school bus (b) tiger.jpg (c) bus.jpg (d) fort.jpg
  37. 37.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="150">
    (a) cake.jpg (b) map.png (c) kite.png (d) A red kite
  38. 38.True or false: in <img>, width describes the picture. (a) False (b) True
  39. 39.True or false: in <img>, src sets how wide it is. (a) True (b) False
  40. 40.🖼️ How many pixels wide is the picture drawn?
    <img src="fort.jpg" alt="An old fort" width="150">

Answer key

  1. No
  2. to describe the image
  3. 300
  4. True
  5. 100
  6. False
  7. Our school bus
  8. 100
  9. kite.png
  10. True
  11. alt
  12. Birthday cake
  13. kite.png
  14. 100
  15. False
  16. cake.jpg
  17. height
  18. An old fort
  19. 50
  20. A tiger asleep
  21. False
  22. width
  23. True
  24. alt
  25. False
  26. True
  27. True
  28. A tiger asleep
  29. src
  30. False
  31. moon.png
  32. <img>
  33. An old fort
  34. False
  35. 400
  36. bus.jpg
  37. kite.png
  38. False
  39. False
  40. 150

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