Devansh sadhotra
Devansh sadhotra

Reputation: 1625

Changing color of placeholder text in my <textarea> for my ionic 2 application

placeholder is red in color before i enter text into it , i want my placeholder to stay in default color

refering to this answer

HTML

<textarea  #myInput id="myInput" rows="1"  placeholder="Enter Question here" maxLength="100" (keyup)="resize()"  [(ngModel)]="addQuestion">
    </textarea>

SCSS file

#myInput {
width: calc(100% - 10px);
border: 0;
border-radius: 0;
background: transparent;
}

ts file

  @ViewChild('myInput') myInput: ElementRef;
   resize() {
    this.myInput.nativeElement.style.height = this.myInput.nativeElement.scrollHeight + 'px';
}

Upvotes: 0

Views: 3416

Answers (1)

Suraj Rao
Suraj Rao

Reputation: 29614

Ionic uses autoprefixer in its build process.

you could use the psuedo-element ::placeholder. Try

 #myInput::placeholder{
    color:red
 }

Upvotes: 4

Related Questions