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 trial

CSS CSS Selectors Going Further with Attribute Selectors and Pseudo-Classes Substring Matching Attribute Selectors Challenge

img title attribute? Why is this the first time I've noticed this and why do we not mention it regularly?

So this is the first time I've seen this img attribute. I knew of alt text and have looked up that not only is alt good for screen readers but SEO as well.

So my question is, why is there a title attribute if there is already a descriptor in alt? Is it a legacy item that may disappear? If not, are there other uses?

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

in my experience alt was always what was read by screen readers and displayed as a tooltip.

But if the alt attribute doesn't display a tooltip then the title attribute will.

Title isn't really specific to the image tag but it's a kind of "label" for your element that can be applied to almost any of the HTML5 elements.

OK thanks.