禁用后,html中Button的颜色应该是什么?

时间:2013-09-23 10:05:48

标签: html css

我正在编写这行代码;

<INPUT TYPE="BUTTON" class="configurationButton" id="btnAddButton" style="width:60px;" name="btnAddButton" value="Add" disabled>

加载时,按钮变为已禁用,但其颜色仍为黑色。由于.configurationButton中有默认的黑色,  请告诉我上面标签示例中禁用按钮的颜色应该是什么?

3 个答案:

答案 0 :(得分:2)

检查JS小提琴

http://jsfiddle.net/Usj5Q/

.configurationButton
{
    background:black;
    color:white;
    cursor:pointer;
}

.configurationButton:disabled
{
    background:white;
    color:gray;
    cursor:default;
    opacity:0.2;

}

答案 1 :(得分:1)

理想情况下,禁用的按钮应该看起来像灰色。如果您想知道各种状态下按钮的样式,可以查看此网址 - http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/bootstrap-buttons.php

答案 2 :(得分:1)

HTML标准未指定输入标记的外观。每个浏览器和每个桌面环境都有自己的外观。