如何去除输入框旁边的input type="date"箭头框?

30 浏览
0 Comments

如何去除输入框旁边的input type="date"箭头框?

我尝试了各种方法,但没有找到有效的解决方案。我以为只需要像这样写:

input[type="date"] {

-webkit-appearance: none;

}

但这并没有起作用。有人知道怎样移除它们吗?

0
0 Comments

如何去除输入框旁边的箭头框?

问题原因:

在移动浏览器上,上述CSS代码无效。

解决方法:

可以尝试使用以下CSS代码去除输入框旁边的箭头框:

input[type="date"]::-webkit-inner-spin-button{
    -webkit-appearance: none;
}

但是,这段代码对于移动浏览器无效。有没有其他解决方法呢?

可以参考这个stackoverflow.com/a/43587645/239211上的回答,这可能是一个更现代的解决方法。

0
0 Comments

通过查看这个回答,您可以找到解决元素上的旋转器问题的方法。

这个回答是通过查看这个问题找到的。

根据这个链接的回答,您可以使用以下CSS样式来隐藏元素旁边的箭头框:

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

这样,您就可以通过隐藏箭头框来解决元素旁边的问题。

0