【问题标题】:html type number won't relocate [duplicate]html类型号不会重新定位[重复]
【发布时间】:2018-07-16 04:00:46
【问题描述】:

我目前正在尝试使用坐标将此数字输入框移动到 CSS 中的某个位置,但到目前为止,我输入的任何内容都不起作用。 我试过了:

top: 30%;
top: 30px;
right: 40%;
right: 40px;

在所有的 CSS 东西中,到目前为止,它们都没有移动过这里的东西是它的 HTML 部分

HTML:

<input class="checkout-delay" type="number" min="0" value="0">

CSS:

.checkout-delay {
    bottom: 30px;
    background-color: #bf0d33;
    color: white;
    font-weight: bolder;
    border-color: #900926;
    height: 15px;
    width: 25px;
}

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button {  
   opacity: 1;
   margin: 0;
}

.input[type="number"] {
    padding: 0 0 0 6px;
    -moz-appearance: textfield;
}

(PS。我还希望能够通过使箭头变大并更改颜色来自定义箭头,但从我在网上阅读的内容看来这是不可能的)

【问题讨论】:

  • 只有当position 是绝对的、固定的或粘性的时,top 和 right 才有效。

标签: html css input


【解决方案1】:

我忘了把这个放在第一位

position: absolute;

哈哈

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-06
    • 1970-01-01
    • 2011-09-22
    • 2015-04-12
    • 2019-03-10
    • 1970-01-01
    相关资源
    最近更新 更多