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

Answer key

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

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