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

Answer key

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

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