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

Answer key

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

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