mozilla firefox 中禁用的 html 按钮不显示工具提示
Mozilla Firefox 将不会显示禁用控件的工具提示。还有其他方式来显示它们吗?
我更喜欢不使用 javascript 的解决方案。
我可以找到一个简单的方法,就是更改 css 样式,
button,
input
{
position: relative;
width: 200px;
}
button[disabled]:hover:before,
input[disabled]:hover:before
{
position: absolute;
top: 10px;
left: 10px;
content: attr(title);
background-color: #ffffe1;
color: #000;
line-height: 10pt;
font-size: 8pt;
border: 1px solid #000;
z-index:10000;
padding:2px;
}
这对于按钮元素来说效果很好,但对于输入类型按钮控件/元素不起作用。
Mozilla Firefox will not display tooltips of disabled controls. Is there another way to display them?
I would prefer a solution without using javascript.
There is an easy method I could find is to change in css styles is
button,
input
{
position: relative;
width: 200px;
}
button[disabled]:hover:before,
input[disabled]:hover:before
{
position: absolute;
top: 10px;
left: 10px;
content: attr(title);
background-color: #ffffe1;
color: #000;
line-height: 10pt;
font-size: 8pt;
border: 1px solid #000;
z-index:10000;
padding:2px;
}
This works fine in case of button element, but does not work for the input type button control/element.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 javascript 工具提示添加动态 html 工具提示。那么您就不需要依赖不同的浏览器如何呈现禁用的 html 元素的工具提示。
trying using a javascript tool tip to add dynamic html tool tips. Then you wont' need to rely on how different browsers render tool tips for disabled html elements.