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

Answer key

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

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