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

Answer key

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

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