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

Answer key

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

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