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

Answer key

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

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