如何在Angular 6材质中更改文本框占位符颜色 [英] How to change text box placeholder color in Angular 6 Material

查看:49
本文介绍了如何在Angular 6材质中更改文本框占位符颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

角度6材料代码.

<mat-form-field>
    <input matInput placeholder="Input">
  </mat-form-field>

当输入元素聚焦时,我想更改默认颜色.

I wanted to change default color when input element get focused.

我已经很累了.如何做我在角材料中使用css更改md-input-container占位符颜色

似乎什么都没有.

推荐答案

如果我理解您的问题,则此CSS应该可以工作.

If i understand your question this css should work.

  .mat-focused .mat-form-field-label {
      /*change color of label*/
      color: red !important;
  }

 .mat-form-field-underline {
   /*change color of underline*/
    background-color: blue !important;
 } 

.mat-form-field-ripple {
   /*change color of underline when focused*/
   background-color: yellow !important;;
 } 

希望它很有用.

这篇关于如何在Angular 6材质中更改文本框占位符颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆