如何更改Bootstrap禁用按钮的颜色? [英] How to change color of Bootstrap disabled button?

查看:106
本文介绍了如何更改Bootstrap禁用按钮的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网站的一个页面上使用引导按钮,我想更改禁用按钮的颜色。一个变灰的按钮,你不能点击。有没有一种方法可以改变这种使用CSS的颜色?这是什么课程?

I am using a bootstrap button on a page of my website and I want to change the color of a disabled button. A button that is "grayed out" and you cannot click. Is there a way I can change the color of this using CSS? Any class for this?

非常感谢!

推荐答案

像这样:

In case your button look like this:

<button class="btn btn-primary" disabled>Button</button>

接下来的CSS代码会改变它的颜色(仅当禁用时):

the next CSS code will change its color (when disabled only):

.btn.btn-primary[disabled] {
    background-color: #00ff00;
}

.btn.btn-primary:disabled{
    background-color: #00ff00;
}

这篇关于如何更改Bootstrap禁用按钮的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆