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

Answer key

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

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