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

Answer key

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

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