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

Answer key

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

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