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

Answer key

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

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