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

Answer key

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

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