HTML: Semantics of “title” Element Content
Post from February 26, 2007 (↻ August 15, 2014), reflecting Jens the Developer.
I already proposed that in October 2005, and I see the need for warming up: It would be useful to allow other elements within the title of an HTML document as well. Why? You otherwise cannot denote abbreviations and stuff, the semantics gets completely lost. For example, you cannot write
<title><abbr>HTML</abbr> document title</title>
(though that abbreviation markup wouldn’t need to be rendered), but are required to use
<title>HTML document title</title>
Thus, there’s no way to tell that “HTML” is an abbreviation here.
The set of elements you could need within title’s certainly limited. However, HTML probably benefits from enabling at least
abbr,del,ins, and eventuallyem, andstrong.
I’ll suggest this again to the respective Working Groups, despite the original responses. And I’m looking forward to your remarks and stimulations.
Update (February 27, 2007)
Lachlan Hunt writes (via W3C mailing list):
For compatibility reasons in HTML,
titlecannot contain elements because of the way it is parsed. It would be possible to do so in XHTML, but then that would be another incompatibility between the 2 languages and there is also limited usefulness in doing so anyway, since many of the use cases for title are plain text. e.g. the window’s title bar, bookmarks, search results, etc.
While enabling other elements within title surely means a compatibility issue, I currently do not believe that you cannot “simply” ignore them under certain circumstances, like in the title bar.
About the Author
Jens Oliver Meiert is a German author, philosopher, adventurer, artist, and developer. Here on meiert.com he shares—and occasionally generalizes and exaggerates—some of his thoughts and experiences.
If you have any questions or concerns about what he writes, ask him to explain, or share your own position by sending a constructive comment or email. (Then, if you think something could be of interest to Jens, recommendations for excellent literature are always welcome.)
Comments (Closed)
-
On February 28, 2007, 15:33 CET, Herbert Schiemann said:
Since the title element is not part of the body I do not see much use in allowing other elements within the title element in HTML. Representational elements like em and strong are not needed in the title element, may-be semantical elements.
On the other hand I cannot see a convincing reason why not to allow any “inline” elements in the title element in XHTML -
On March 1, 2007, 13:16 CET, Jens Oliver Meiert said:
Well, there are several use cases, not only for abbreviations and stuff, but also to indicate changes in language. Thus, this limitation becomes even more “interesting,” it’s not just a spec inconsistency.
By the way, please consider (and participate in) the ongoing discussion on the W3C www-html mailing list (February and March archives).
-
On March 2, 2007, 14:33 CET, Robin Hodson said:
Although (trivally), you things like
<title lang="fr">J’ai eu un chat</title>
So all is not completely lost.Search engines are quite good at picking up context, anyway.
If you’re really worried about it, surely XHTML is the way to go, anyway?
Read More
Have a look at the most popular posts, possibly including:
Looking for a way to comment? Comments have been disabled, unfortunately.
