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

Answer key

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

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