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

Answer key

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

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