本文介绍了简单的工具提示 - 标题属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想要显示一个消息时,用户鼠标悬停在一个对象上,最近我只是在我的html标签上使用 title 属性,因为它很简单,并且不会自动关闭。



问题:使用 title 属性是依赖于工具提示的一件坏事吗?



忽略无法自定义的事实,我对使用定制工具提示的功能感到好奇(例如标准用户如何与它交互)。例如,我阅读的使用 title 属性添加一个机智当你悬停在它上面的评论/ factoid。然而,并不是很多人似乎知道它。



因此,标题似乎可能对评论有好处,甚至可能会说一个图片,但它是一个真正的简单的工具提示?



考虑到一个'真正'的工具提示,你通常需要1-2个额外的元素,CSS(并且取决于你如何设置它,可能是一些内联样式来放置),甚至可能是java-script, title 属性是不好用的,因为(再次)它不能被定制,通常是很小的注意:如果它有帮助(思考的食物),那么它可能会在一段时间后出现。

,我目前的情况引发了这个问题,我喜欢当一个网站有类似于 [?] 的东西时,您可以将鼠标悬停在上面以查找更多详细信息,而不用将它们放入页面,因此保持简单。
另外,我从w3schools学到了html,他们从未提及过属性,所以不太确定它们的用途/用途。 (是的,提到w3schools的一部分是一个(坏)尝试获得同情)

我发现这个问题有点奇怪,要求考虑SO使用它们很多,但随时可以假设我对此一无所知......好吧......我真的没有这样做)

title属性(@title)不应该被使用。



  1. 每个浏览器都使用@title自己做,即使看起来相同。 >对于只使用键盘的人,他们无法获取@title中的信息。

  2. 从移动设备访问网站的用户无法获取信息。

  3. 有些但不是所有的辅助技术都可以获得@title


    1. 中的信息,允许在启用后读取它。哪些人(用户)知道的不多。



    2. $其他技术仅会忽略链接文本并仅读取@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.

      1. Every browser does their own thing with the @title, even though it looks the same.
      2. For people who just use the keyboard, they cannot get the information in @title.
      3. People accessing the site from a mobile device, cannot get the information.
      4. Some, but not all assistive technology can get the information in the @title

        1. some allows it to be read after enabling it. Which not many people (users) know about.
        2. 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

      这篇关于简单的工具提示 - 标题属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 23:42
查看更多