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

Answer key

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

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