- 中的信息,允许在启用后读取它。哪些人(用户)知道的不多。
$其他技术仅会忽略链接文本并仅读取@title。 b
$ b 4.2:
< a href =#title =Are你确定?>删除你的帐户< / a>
这会显示为:
进一步阅读:
When I want to have a message show when a user mouse overs an object, and lately I just use the title attribute on my html tags since it's simple and automatically doesn't go off screen.
Question: Is using the title attribute is a bad thing to rely on for a tool-tip?
Ignoring the fact you can't customize it, I'm curious about functionality over using a custom made tool-tip (such as how the standard user interacts with it). A specific web-comic I read, for example, uses the title attribute to add a witty comment / factoid when you hover over it. Yet not many people seem to know about it.
As such it seems a title might be good for a comment, or even saying author of a picture, but is it good for a true simply tool-tip?
Considering for a 'real' tool-tip you need usually 1-2 extra elements, css (and depending how you set it up, possibly some inline style for placement), and possibly even java-script, is the title attribute bad to use since (again) it cannot be customized, is often a small off-topic detail about the element, and only appears after a set amount of time.
Note: If it helps (food for thought), my current situation that brought this question on, is I like when a site has something like [?]
for you to hover over to find more details without shoving them into the page, thus keeping it simple.Also, I learned html from w3schools, and they never mention the title attribute, so not really sure what they are intended / should be used for. (and yes, mentioning w3schools part was a (bad) attempt at getting sympathy)
And I find this question kind of weird to ask considering SO uses them quite a bit, but feel free to assume I know nothing about it as... well... I really don't)
解决方案
The title attribute (@title), should not be used.
- Every browser does their own thing with the @title, even though it looks the same.
- For people who just use the keyboard, they cannot get the information in @title.
- People accessing the site from a mobile device, cannot get the information.
- Some, but not all assistive technology can get the information in the @title
- some allows it to be read after enabling it. Which not many people (users) know about.
- other technology simply ignores the link text and reads the @title only.
Ex of 4.2:
<a href="#" title="Are you sure?">Delete your account</a>
This will read:
Further Reading: PG: Title attribute
这篇关于简单的工具提示 - 标题属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!