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

Answer key

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

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