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

Answer key

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

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