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

Answer key

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

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