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

Answer key

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

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