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

Answer key

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

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