如何摆脱输入日期的x和向上/向下箭头元素? [英] How to get rid of x and up/down arrow elements of a input date?
问题描述
>
我需要在框中显示的是橙色三角形,我不知道如果我需要CSS或其他东西来摆脱三角形的左边的两个元素。
The only thing that I need showing up in the box there is the orange triangle, and I am not sure if I need CSS or something else to get rid of the two elements to the left of the triangle.
有办法吗?我只是使用输入类型 date
。
Is there a way to do so? I am just using the input type date
.
小提琴: http://jsfiddle.net/5M2PD/1/
推荐答案
使用伪类 -webkit-inner-spin-button
为基于webkit的浏览器设置样式:
Use the pseudo-class -webkit-inner-spin-button
to style it specific for webkit-based browsers:
input[type=date]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
如果要更改下拉箭头的样式,类 -webkit-calendar-picker-indicator
:
If you want to change the style of the dropdown arrow, use the pseudo-class -webkit-calendar-picker-indicator
:
input[type=date]::-webkit-calendar-picker-indicator {
-webkit-appearance: none;
display: none;
}
要取消清除按钮,请将输入设置为必需:
To eliminate the clear button, set the input to required:
<input type="date" required="required" />
这篇关于如何摆脱输入日期的x和向上/向下箭头元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!