Library › Coding AI › High school students
Write alt text for a club page, including the decorative image
Practice: Giving the right context. About 5 minutes.
About this exercise
Your robotics club page needs alt text. Write it for all 4 images, each under 12 words and never starting with 'Image of', 'Picture of' or 'Photo of'. The divider is decorative, so it gets alt="" and role="presentation". Club style: chart alts start with 'Chart:' and give the takeaway, here that the average match score rose from 42 to 87. Return only the 4 img tags, one per line, with src and class unchanged, in exactly 1 code block, under 20 words of text.
Common mistakes when you ask AI for this
- Describing the divider. The AI writes alt text for every image, so screen readers announce a meaningless gear. Try: Add: "The divider is decorative: alt=\"\" and role=\"presentation\"."
- A chart alt with no point. The AI writes 'bar chart of scores', which hides the takeaway. Try: Add: "Chart alt starts with 'Chart:' and says the average score rose from 42 to 87."
- 'Image of...' openers. Screen readers already say 'image', so the AI's favorite opener wastes words. Try: Add: "Under 12 words each, never start with Image of, Picture of or Photo of."
- The whole page back. The AI reprints the full HTML and explains alt text. Try: Add: "Return only the 4 img tags, one per line, no text."
What a strong prompt includes
- Handles the decorative image
- Gives the chart's takeaway
- Caps each alt
- Bans the usual opener
- Asks for only the img tags
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)