对于mozilla firefox中禁用的html按钮,不显示工具提示

时间:2011-04-15 16:04:04

标签: html firefox button tooltip disabled-control

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;
}

这在按钮元素的情况下工作正常,但对输入类型按钮控件/元素不起作用。

1 个答案:

答案 0 :(得分:2)

尝试使用javascript工具提示添加动态html工具提示。然后你不需要依赖不同的浏览器如何为禁用的html元素呈现工具提示。