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

Answer key

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

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