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

Answer key

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

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