Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialFrancesco Vitale
4,962 PointsHi, I can I fix these validation errors regarding the ALT attributes in HREF tags:
Error: Attribute alt not allowed on element a at this point. From line 37, column 19; to line 37, column 54 <a href="img/numbers-01.jpg" alt=""> ā©
Error: An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images. From line 38, column 19; to line 38, column 48 <img src="img/numbers-01.jpg">ā©
Error: Attribute alt not allowed on element a at this point. From line 44, column 19; to line 44, column 54 <a href="img/numbers-02.jpg" alt=""> ā©
Error: An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images. From line 45, column 19; to line 45, column 48 <img src="img/numbers-02.jpg">ā©
2 Answers
james south
Front End Web Development Techdegree Graduate 33,271 Pointsalt attributes go in img tags, not anchor tags.
Liam English
3,837 PointsAs James has said above, alt attributes go inside img tags. for anchor tags you should use the title attribute instead.
Example:
<img src="#" alt="alt text">
<a href="#" title="title text">anchor text</a>