Tooltip is not displayed for a disabled html button in mozilla firefox

流过昼夜 提交于 2020-01-14 03:09:09

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/5679472/tooltip-is-not-displayed-for-a-disabled-html-button-in-mozilla-firefox

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