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

Answer key

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

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