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

Answer key

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

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