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

Answer key

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

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