twitter-bootstrap 如何更改引导程序按钮?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19196467/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How change the bootstrap buttons?
提问by Leito
In bootstrap.css changed the color of the button btn-primary in different states, but somehow able to hover, it stands only half. Where is it possible to fix? Thank you.
在 bootstrap.css 中改变了按钮 btn-primary 在不同状态下的颜色,但不知何故能够悬停,它只站立一半。哪里可以修?谢谢你。
回答by lvarayut
In the bootstrap.css, you able to change the color of button in the class btn-primaryin different states. Let's see the following code:
在 bootstrap.css 中,您可以更改类btn-primary中不同状态下按钮的颜色。让我们看看下面的代码:
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
So. you can change the color, background-color, and etc as you wish.
所以。您可以根据需要更改颜色、背景颜色等。
回答by Ahmed Na.
working with Bootstrap buttons is very easy refer to buttons.
使用 Bootstrap 按钮非常容易,请参阅按钮。
also you can change their behavior by targeting the button class in the Bootstrap.css or in your custom.css file that override Bootstrap.css
您也可以通过在 Bootstrap.css 或覆盖 Bootstrap.css 的 custom.css 文件中定位按钮类来更改它们的行为
for example:
例如:
- you used button defaultor primaryor any other button type.
- search in your Bootstrap.css for class like .btn-defaultor .btn-primaryor any other class .btn-xxxx.
- you will have your button states ( hover, focus, active) change the value as you want like
- 您使用了按钮默认或主要或任何其他按钮类型。
- 在 Bootstrap.css 中搜索.btn-default或.btn-primary或任何其他类.btn-xxxx 之类的类。
- 您将拥有您的按钮状态(悬停、焦点、活动)根据需要更改值
color:---> for the color of the font on the button.
color:---> 按钮上字体的颜色。
background-color:---> for the background color of the button, and so on.
background-color:---> 按钮的背景色,依此类推。
hope this help you , and if you need more help pleas upload a live code.
希望这对您有所帮助,如果您需要更多帮助,请上传实时代码。
回答by Andrea Scarafoni
if you want to change css at main application level, the best way is to use http://getbootstrap.com/customize/
如果要在主应用程序级别更改 css,最好的方法是使用http://getbootstrap.com/customize/
回答by Tula
change class name...example:
.btn-test { color: #FF5733; background-color: #800000;
}
.btn-test:hover { color: #800000; background-color: #FF5733; }
更改类名...示例:
.btn-test { 颜色:#FF5733; 背景色:#800000;
}
.btn-test:hover { 颜色:#800000; 背景颜色:#FF5733;}

