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

Answer key

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

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