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

Answer key

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

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