CSS 如何在 Twitter Bootstrap 中更改 input 和 textarea 元素的边框/轮廓颜色?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17097512/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 23:12:26  来源:igfitidea点击:

How can I change the border/outline color for input and textarea elements in Twitter Bootstrap?

csstwitter-bootstrap

提问by change

I want to change the color of bootstrap textbox from the default blue. tried:

我想从默认的蓝色更改引导文本框的颜色。试过:

.input-small,
.input-medium {
    border-color: #E56717;
}

Not of much help. Also tried ":focus"

帮助不大。也试过 ":focus"

回答by Ryan

I presume you're speaking about the blue glow on focus? Try this:

我想你是在谈论焦点上的蓝光?尝试这个:

textarea:focus, input:focus, input[type]:focus, .uneditable-input:focus {   
    border-color: rgba(229, 103, 23, 0.8);
    box-shadow: 0 1px 1px rgba(229, 103, 23, 0.075) inset, 0 0 8px rgba(229, 103, 23, 0.6);
    outline: 0 none;
}

回答by Beel

If you are using bootstrap 3 with LESS, you can set the variable @input-border-focus. This variable can be found in variables.less.

如果您使用带有 LESS 的引导程序 3,您可以设置变量@input-border-focus. 这个变量可以在variables.less.

回答by Mohamed Kawsara

To whom visited this page and didn't find a solution, what I did is replacing -webkit-focus-ring-colorwith desired color and it works just fine!

对于访问此页面但没有找到解决方案的人,我所做的是替换-webkit-focus-ring-color为所需的颜色,并且效果很好!