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

Answer key

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

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