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

Answer key

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

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