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

Answer key

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

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