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

Answer key

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

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