How do you render tooltip on disabled HTML Button

This idea's based on the following (x)html:

<form><fieldset><buttondisabledtitle="this is disabled">disabled button</button></fieldset></form>

And uses the following CSS to achieve something close to your aim:

    button  {position: relative;}

    button:hover:after
        {position: absolute;
        top:0;
        left:0;
        content: attr(title);
        background-color:#ffa;
        color:#000;
        line-height:1.4em;
        border:1px solid #000;}

It's not ideal, but it was the best non-JavaScript idea I could come up with.

from:http://stackoverflow.com/questions/2151575/how-do-you-render-tooltip-on-disabled-html-button

原文地址:https://www.cnblogs.com/joe-yang/p/3419536.html