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

Answer key

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

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