gpt4 book ai didi

html - CSS : Want an input type number CSS just like google

转载 作者:太空宇宙 更新时间:2023-11-04 09:11:59 26 4
gpt4 key购买 nike

我正在尝试制作 input type number 的 css,就像在 Google Chrome 中一样。但它在我的 mozila 浏览器中不起作用。

image

我不知道如何让它像在谷歌浏览器中看到的那样。

input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
cursor:pointer;
display:block;
width:8px;
color: #333;
text-align:center;
position:relative;
}

input[type=number]::-webkit-inner-spin-button:before,
input[type=number]::-webkit-inner-spin-button:after {
content: "^";
position:absolute;
right: 0;
font-family:monospace;
line-height:1px;
}

input[type=number]::-webkit-inner-spin-button:before {
top:0px;
}

input[type=number]::-webkit-inner-spin-button:after {
bottom:0px;
-webkit-transform: rotate(180deg);
}
<input type="number" value="10" max="15">

最佳答案

那是因为你不能在 ::webkit-inner-spin-button 上使用类。

参见this对于 working example

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. source

enter image description here

关于html - CSS : Want an input type number CSS just like google,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42071941/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com