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

Answer key

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

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