Html 从角材质中的“垫形状”字段隐藏箭头
我正在使用Html 从角材质中的“垫形状”字段隐藏箭头,html,css,angular,angular-material-6,Html,Css,Angular,Angular Material 6,我正在使用mat表单字段输入电话号码。这是我的基本代码 <mat-form-field class="full-width"> <input matInput type="number" placeholder="Telefonnummer für Rückruf" value="" [(ngModel)]="this.inputValues.phone"> </
mat表单字段
输入电话号码。这是我的基本代码
<mat-form-field class="full-width">
<input matInput type="number" placeholder="Telefonnummer für Rückruf" value="" [(ngModel)]="this.inputValues.phone">
</mat-form-field>
顺便说一下,当我将鼠标悬停在这个组件上时,它会显示箭头/旋转按钮
请让我知道如何自定义此组件,使其不再显示箭头/旋转按钮
亲切问候,,
Jie每当输入类型为
number
时,就会出现箭头/微调器。它可以使用css/scss删除。这提供了示例和进一步的信息
请尝试以下css/scss代码:
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
将以下CSS代码添加到
style.CSS
中时,应该将其隐藏
/* Chrome, Safari, Edge, Opera */
input[matinput]::-webkit-outer-spin-button,
input[matinput]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[matinput][type=number] {
-moz-appearance: textfield;
}
它在我这边正常工作。谢谢你@Sai Vasmsi