现在,我有一个文本区域,它是从字符串中获取文本的。我将文本区域的背景颜色设置为黑色,但是默认的文本颜色为黑色,因此,除非突出显示它,否则看不到它。我似乎找不到找到将字体颜色更改为白色的方法。CSS中有一种简单的方法可以做到这一点吗?
html
<div class="mainWindow">
<div class="valueOutput" [hidden]="hideThis">
<textarea resize=none readonly="textareaEdit" rows="8" cols="50" style="background-color: black;" [(ngModel)]="outputTexT" ></textarea>
</div>
<div class="labelOutput" [hidden]="hideThis">
<textarea readonly="textareaEdit" rows="8" cols="46" style="background-color: black;" [(ngModel)]="labelText"></textarea>
</div>
<textarea rows="20" cols="91" [style.font-size.px]="20" [style.padding-top.px]="130" readonly="textareaEdit" style="background-color: #b6b7b4;" [(ngModel)]="mainStepText"></textarea>
</div>
Run Code Online (Sandbox Code Playgroud)
用于textarea的字符串
private labelText: String = "test1 \ntest2 \ntest3";
Run Code Online (Sandbox Code Playgroud)
当前的CSS
.mainWindow{
width: 1000px;
height: 310px;
vertical-align: middle;
resize: none;
overflow: auto;
-ms-overflow-style: none;
background-color: #B5B6B6;
}
.valueOutput{
position: absolute;
resize: none !important;
padding-left: 600px;
}
.labelOutput{
position: absolute;
resize: none !important;
padding-left: 250px; …Run Code Online (Sandbox Code Playgroud) css ×1