Html 有没有办法让 title= 属性在 Chrome 上工作?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10391327/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
is there a way to make title= attribute work on Chrome?
提问by zeroality
<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?
在 Firefox 中,这将显示带有“悬停文本”的工具提示,但在 Chrome 中,您什么也得不到。有什么办法可以用 HTML/CSS 解决这个问题,还是需要另一种脚本语言?
回答by gcochard
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?
title="hover text"
是 chrome 的工作方式。您确定在跨度文本之上没有其他内容(可能是没有内容的 div)吗?
回答by Hitham S. AlQadheeb
It works for me with only title.
它对我有用,只有标题。
You should use both alt="Hover text"
and title="Hover text"
你应该同时使用alt="Hover text"
和title="Hover text"
回答by Aiwha
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.
虽然这是一个非常老的帖子,但我没有看到任何答案。我遇到了同样的问题,对我来说问题是元素落后于另一个元素。我已经使用 z-index 将其向上移动并解决了它。
回答by leszek.hanusz
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 reportwhich is apparently fixed in latest versions
如果您从 Google 来到这里寻找有关在 linux 下使用 Chromium 的标题属性中的故障的答案。然后你可能对这个错误报告感兴趣,它显然在最新版本中得到了修复
回答by Gil
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...
我也遇到了在 div 上定义的“标题”工具提示没有显示的问题。就我而言,这不是特定于浏览器的东西,但我想无论如何我都会在这里发布...
I solved it by defining a higher z-index.
我通过定义更高的 z-index 解决了这个问题。
回答by eebbesen
<!DOCTYPE html>
<html>
<body>
<span title="Hover text">Hello World</span>
</body>
</html>
works for me
为我工作