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

Answer key

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

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