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

Answer key

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

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