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

Answer key

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

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