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

Answer key

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

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