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

Answer key

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

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