gpt4 book ai didi

html - 找不到更正我的输入文本框的方法

转载 作者:太空宇宙 更新时间:2023-11-03 22:35:14 25 4
gpt4 key购买 nike

所以我有一个小输入框,我只想在其中接受数字,而且外观和一切都很好,但是当我单击它时,该框会绘制另一个框 + 向上和向下箭头。想摆脱两者。另外,我怎样才能像第一张图片那样在它的开头添加一个小图标。

在框内单击时我想要这个 + 添加小搜索图标

enter image description here

但是我明白了:

enter image description here

html:

<div class="GeolocationInput  os-animation" data-os-animation="zoomInUp" data-os-animation-delay="1.5s">
<div style="width: 100%;">
<form class="GeolocationInput-form ">
<div>
<input type="number" class="GeolocationInput-input" placeholder="Escribe tu Codigo Postal..." >
</div>
<div>
<button class="GeolocationInput-button" disabled="">Continuar</button>
</div>
</form>
</div>
</div>

CSS:

.GeolocationInput {
max-width: 700px;
margin: 0 auto;
text-align: center;
-webkit-font-smoothing: antialiased;
}

.GeolocationInput .GeolocationInput-form {
width: 274px;
margin: 10px auto 0;
}
.GeolocationInput .GeolocationInput-input {
width: 274px;
}

.GeolocationInput-input {
box-sizing: border-box;
width: 90%;
border: 1px solid #aebcce;
border-radius: 100px;
padding: 15px 40px 10px 42px;
margin: 0 0 15px;
font-size: 16px;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 300;
}


.GeolocationInput-button {
background: #635bd4;
max-width: 275px;
width: 90%;
color: #fff;
cursor: pointer;
font-size: 16px;
padding: 16px 32px;
text-decoration: none;
white-space: nowrap;
border-radius: 100px;
border: none;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 500;
text-align: center;
}

http://jsfiddle.net/zhpmahnq/192/

最佳答案

你可以删除边框:

.GeolocationInput-input:focus {
outline: none;
}

箭头有点难去除,不同的浏览器需要不同的规则。

对于 Webkit 浏览器(如 Chrome),您需要:

.GeolocationInput-input::-webkit-outer-spin-button,
.GeolocationInput-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

对于 Firefox,您需要:

.GeolocationInput-input {
-moz-appearance: textfield;
}

所有这些都已添加到以下示例中:

.GeolocationInput {
max-width: 700px;
margin: 0 auto;
text-align: center;
-webkit-font-smoothing: antialiased;
}

.GeolocationInput .GeolocationInput-form {
width: 274px;
margin: 10px auto 0;
}
.GeolocationInput .GeolocationInput-input {
width: 274px;
}

.GeolocationInput-input {
box-sizing: border-box;
width: 90%;
border: 1px solid #aebcce;
border-radius: 100px;
padding: 15px 40px 10px 42px;
margin: 0 0 15px;
font-size: 16px;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 300;
-moz-appearance: textfield;
}

.GeolocationInput-input:focus {
outline: none;
}

.GeolocationInput-input::-webkit-outer-spin-button,
.GeolocationInput-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

.GeolocationInput-input::-webkit-outer-spin-button,
.GeolocationInput-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

.GeolocationInput-button {
background: #635bd4;
max-width: 275px;
width: 90%;
color: #fff;
cursor: pointer;
font-size: 16px;
padding: 16px 32px;
text-decoration: none;
white-space: nowrap;
border-radius: 100px;
border: none;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 500;
text-align: center;
}
        <div class="GeolocationInput  os-animation" data-os-animation="zoomInUp" data-os-animation-delay="1.5s">
<div style="width: 100%;">
<form class="GeolocationInput-form ">
<div>
<input type="number" class="GeolocationInput-input" placeholder="Escribe tu Codigo Postal..." >
</div>
<div>
<button class="GeolocationInput-button" disabled="">Continuar</button>
</div>
</form>
</div>
</div>

希望对您有所帮助! :)

关于html - 找不到更正我的输入文本框的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46800658/

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