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

Answer key

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

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