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

Answer key

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

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