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

Answer key

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

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