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

Answer key

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

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