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

发布于 2024-11-01 05:50:48 字数 557 浏览 10 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浊酒尽余欢 2024-11-08 05:50:48

尝试使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文