-
Notifications
You must be signed in to change notification settings - Fork 13
Description
http://w3c-webmob.github.io/installable-webapps/#names
Instead of a separate <meta> element, why not just use a title attribute on the <title> element?
<title title="Long, detailed, SEO-friendly etc. title">Short app name (for homescreens)</title>Joel_MMCC makes the case for this pattern here: http://mathiasbynens.be/notes/touch-icons#comment-76 IMHO it’s hard to disagree with the points he’s making. I’ll echo his comment here:
On the matter of shorter vs. longer web page titles, it looks like the HTML spec itself allows for this already, without needing anything new added to the spec, and requiring absolutely no proprietary vendor metatags (e.g. Mathias’s
<meta name="apple-mobile-web-app-title" content="Short title for home screen">above).It’s so simple! According to the HTML 5 spec (and I believe HTML 4 as well), the
title="…"attribute is a global attribute that can be used with any HTML tag! That includes the<title>tag itself!So, hypothetically, you could do this:
<title title="Long SEO-friendly overly verbose page title goes here">Short title here.</title>Voila! This should even validate nicely, as-is!
Now all that’s needed is for user agents (browsers and spiders) to decide what to do with that. I recommend a “smart” approach: For touch icon titles and the like, always use the shorter title that is the inner content of the
<title>tag.For browser window titles, likewise display the inner content of the
<title>tag if the browser window is too narrow to display the longer one in thetitle="…"attribute (e.g. portrait orientation, manually reduced in size, etc.).Search engines can simply use both as they see fit for their metadata and rankings.
There’d also be no reason that the two couldn’t be swapped (longer title as the tag’s inner content, shorter as the
title="…"attribute, instead of vice versa) and have the user agent simply react intelligently based on which is longer and which is shorter, but traditionally thetitle="…"attribute is used to provide longer descriptive text for some usually shorter or smaller element via a ToolTip (e.g. for<img>,<a>,<abbr>,<acronym>, etc. tags), so that should be the preferred usage.