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

Answer key

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

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