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

Answer key

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

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