【发布时间】:2019-08-05 13:04:03
【问题描述】:
我正在尝试使用颜色设置只读<input> 元素的样式。我查看了不同的代码,只找到了
<input readonly>
或
<input readonly="true">
但有
<input [readonly]="(!groupForm.errors?.validateCode) ? true : null &&
(groupForm.dirty || groupForm.touched)" type="text" id="specNr"
class="form-control" formControlName="specNr" >
我找不到解决方案。我已尝试使用以下 CSS,但没有成功。
input[readonly]{
background-color: #f17517;
}
【问题讨论】: