我使用以下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;
}
但是,虽然这适用于单行输入:
它不适用于textarea:
有点不知所措,为什么它没有回应变化。有帮助吗?
答案 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;
}