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

Answer key

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

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