小编ts1*_*993的帖子

无法更改 Angular 材质输入占位符的文本颜色

我正在尝试更改角度材质输入上的占位符文本颜色。似乎默认为黑色,但由于背景颜色较深,我希望它为白色。

我可能已经阅读了该网站上有关如何执行此操作的所有帖子,但似乎没有任何效果。::ng-deep 和 mat-placeholder 不是选项。

这是我的 HTML 的一个片段:

    <form #searchForm="ngForm" class="example-full-width mr-auto">
      <mat-form-field style="width: 350px; font-size: 14px; margin-bottom: -15px;">
        <mat-label style="color: white;">Search for an Employee</mat-label>
        <input matInput [(ngModel)]="userIdInput" placeholder="Enter at least 2 characters of a name or ID"
Run Code Online (Sandbox Code Playgroud)

html angular-material angular

5
推荐指数
1
解决办法
8977
查看次数

标签 统计

angular ×1

angular-material ×1

html ×1