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

Answer key

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

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