我在我的应用程序中有一些数字值输入
<td class="p-0 d-xl-table-cell d-none">
<ul class="p-0 m-0">
<li *ngFor='let item of product.items' class="def-number-input number-input d-flex justify-content-center">
<input type="number" [(ngModel)]="item.quantity" (change)="this.updateCart(item)" style="height: 45px; line-height: 45px" min="0">
</li>
</ul>
</td>
我已成功消除了默认情况下在输入框内用于修改计数器值的箭头,使用以下CSS。
input {
text-align: center;
border: 1px solid #6C757D;
}
.number-input input[type="number"] {
-webkit-appearance: textfield !important;
-moz-appearance: textfield !important;
appearance: textfield !important;
}
.number-input input[type=number]::-webkit-inner-spin-button,
.number-input input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
.number-input {
margin-bottom: 20px;
padding-top: 20px !important;
}
我的疑问是,现在我想添加少和多按钮来修改输入值,但我找到的所有示例都将它们放在输入框外面,例如侧面按钮。 有没有办法将按钮放在输入框内部? 附上一个网站的图像,这将是理想的结果。 提前致谢。
![enter image description here](https://istack.dev59.com/KXD4C.webp)