3 回答

TA貢獻1752條經(jīng)驗 獲得超4個贊
使用padding
,您不需要更改height
輸入的 。要更改占位符的顏色,請使用::placeholder
。增加font-size
也會增加輸入的高度。
input {
? padding: 8px;
? font-size: 18px;
? border: 1px solid #efefef;
? border-radius: 3px;
}
input::placeholder {
? color: lightgray;
}
<input placeholder="Example Input" />

TA貢獻1828條經(jīng)驗 獲得超3個贊
<mat-form-field>
<mat-label>Find {{ this['groupType'] }} by Name</mat-label>
<input type="text" matInput (keyup)="searchList($event.target.value)" style="padding: 3px 10px; font-size: 20px;"/>
</mat-form-field>

TA貢獻1802條經(jīng)驗 獲得超10個贊
只需刪除 mat-label 并在 mat 輸入中添加占位符屬性即可。
<mat-form-field appearance="outline">
<input type="text" matInput (keyup)="searchList($event.target.value)" placeholder="Find {{ this['groupType'] }} by Name" />
</mat-form-field>
工作 stackblitz:https://stackblitz.com/edit/angular-fjhtdf
- 3 回答
- 0 關(guān)注
- 218 瀏覽
添加回答
舉報