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

Answer key

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

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