Bootstrap textarea焦点不响应CSS更改

时间:2014-12-13 13:56:45

标签: css twitter-bootstrap twitter-bootstrap-3

我使用以下CSS更改了输入的焦点边框发光:

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
    border-width:2px;
    border-color: #BD2525;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.075) inset, 0 0 0px rgba(126, 239, 104, 0.6);
    outline: 0 none;
}

但是,虽然这适用于单行输入: enter image description here

它不适用于textarea: enter image description here

有点不知所措,为什么它没有回应变化。有帮助吗?

2 个答案:

答案 0 :(得分:0)

设置新规则

textarea:focus { background: pink; }

答案 1 :(得分:0)

将其设置为新规则不起作用。但是,添加重要规则和新规则确实如此:

textarea:focus {    
    border-width:2px  !important;
    border-color: #BD2525 !important;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.075) inset, 0 0 0px rgba(126, 239, 104, 0.6)  !important;
    outline: 0 none  !important; 
}