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

Answer key

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

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