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

Answer key

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

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