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

Answer key

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

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