is there a way to make title= attribute work on Chrome?

不打扰是莪最后的温柔 提交于 2019-12-19 05:22:14

问题


<span title="Hover text">Hello World</span>

In Firefox, that will display a tooltip with "Hover text" but in Chrome, you get nothing. Any way to fix this with HTML/CSS or is another scripting language required?


回答1:


title="hover text" is the way chrome works. Are you sure you don't have something else (maybe a div with no content) overtop of the span text?




回答2:


It works for me with only title.

You should use both alt="Hover text" and title="Hover text"




回答3:


Though this is a really old post i've seen no answer. I've had the same sort problem and for me the problem was that the element was behind another. I've moved it up using z-index and that solved it.




回答4:


<!DOCTYPE html>
<html>
  <body>
    <span title="Hover text">Hello World</span>
  </body>
</html>

works for me




回答5:


If you come here from Google looking for an answer about glitches in the title attribute using Chromium under linux. Then you can be interested in this bug report which is apparently fixed in latest versions




回答6:


I also had an issue with "title" tooltip defined on a div not showing. In my case it wasn't a browser-specific thing, but I thought I'll post it here anyway...

I solved it by defining a higher z-index.



来源:https://stackoverflow.com/questions/10391327/is-there-a-way-to-make-title-attribute-work-on-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!