Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the font color in a textarea

Tags:

css

Right now I have a text area that gets it's text from a string. I have the background color set to black for the text-area, however the default text color is black, so until you highlight it you can't see it. I can't seem to find a way to change the font color to white. Is there an easy way in CSS to do this?

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>

string used for textarea

private labelText: String = "test1 \ntest2 \ntest3";

current 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;
}
like image 849
John Avatar asked Mar 09 '23 00:03

John


1 Answers

  1. For inline CSS, you can change the style to following:
style="background-color: black;color:#fff;"
  1. Or you can add the following in your CSS file:
textarea {
  color: #fff;
    }
like image 187
Suraj Lulla Avatar answered Mar 29 '23 08:03

Suraj Lulla