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

Answer key

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

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