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

Answer key

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

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