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

Answer key

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

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