删除HTML5输入类型=“时间”时出现的箭头

时间:2017-04-06 05:20:05

标签: javascript css html5 input time

我使用默认的HTML5 样本代码行: 我使用了自定义背景。我想删除右侧出现的黑色箭头。

The image shows a black arrow that appears. Need it remove it. I tried many css tricks but didn't work.

示例代码

2 个答案:

答案 0 :(得分:6)

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0; 
}

/* Hide the cancel button */
::-webkit-search-cancel-button { 
    -webkit-appearance: none; 
}

/* Hide the magnifying glass */
::-webkit-search-results-button {
     -webkit-appearance: none; 
}

/* Remove the rounded corners */
input[type=search] { 
    -webkit-appearance: none; 
}

答案 1 :(得分:2)

箭头

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

清除(x)按钮

input[type="time"]::-webkit-clear-button {
  -webkit-appearance: none;
}