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

Answer key

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

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