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

Answer key

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

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