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

Answer key

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

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