Nested TITLE attributes Oct07 '05
When both parent and child elements contain a title attribute, the child element wins. I don’t know why this is the case, but it seems to be consistent.
For example, quite often an image is also a link. So, the HTML would look something like this:
<a title="Title for this link"><img title="Title for this image" /></a>
When the mouse pointer hovers over this image (contained within a link), the "tooltip" will contain "Title for this image."
I’m not sure if the inner-most child element always wins, or just in this case.
In any case, it got me thinking about XML, and the redundancies that similar attributes cause.
Also, as far as accessibility, does it matter where the title attribute goes?
Categories: Accessibility
, Markup
, XHTML
, XML ![]()
Add Feedback (view all)
Leave feedback
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Similar Entries
- RSS Best Practices? (4 recent visits)
- What are your RSS opinions? (2 recent visits)
- TITLE attribute for everything (2 recent visits)
- URI as <title> (2 recent visits)
- Be careful with nested FOR statements (2 recent visits)
Stats
1 unique visit since August 2008