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

Answer key

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

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