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

Answer key

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

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