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

Answer key

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

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