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

Answer key

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

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