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

Answer key

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

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