I只需要在几个选定的输入上删除数字旋转器。如果我放
/* 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;
}
在我的styles.scss文件中,旋转器消失了。我需要的是一种仅将其应用于选定的类别的方法,因此我可以将类应用于所需的输入。当我将该代码放入本地SCSS文件中的类中时,它就无法使用。
//style.scss
.remove-spinner {
/* 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;
}
}
//Use in html As
<div class="remove-spinner">
<mat-form-field appearance="outline" class=" no-space-field">
<mat-label>Search</mat-label>
<input type="number" matInput placeholder="Type here...">
</mat-form-field>
</div>
请让我知道是否需要任何帮助