javascript - 从日期输入中隐藏箭头
问题描述
我试图从日期输入中隐藏额外的信息和箭头,但它没有隐藏在 Chrome 浏览器中,它确实隐藏在 IE 中。
我正在使用以下 CSS 并且看不到任何错误。
input[type=date]:-webkit-datetime-edit,
input::-webkit-inner-spin-button,
input::-webkit-clear-button {
display: none;
}
解决方案
你可以试试这个:
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
display: none;
-webkit-appearance: none;
}
或者,您可以在 HTML 中包含一个类,.remove--arrow
然后试试这个:
.remove--arrow {
-webkit-appearance: none;
}
.remove--arrow::-webkit-inner-spin-button,
.remove--arrow::-webkit-calendar-picker-indicator {
display: none;
-webkit-appearance: none;
}
推荐阅读
- ruby - RoR collection_select(不起作用) V collection_check_boxes(起作用!) - 为什么?
- ajax - 使用 Laravel + Vuejs ajax 发送电子邮件
- python - 从 2 个 CSV 文件中写入每个组合
- mysql - Mysql最新记录对比
- javascript - 为什么ajax'post'不起作用?
- java - 在android java中以超级用户身份在系统根文件中创建文件主机
- ios - 每次我进行更改时预览都会出错(SwiftUI)
- react-native - 为什么我的文本没有显示在我的导入视图中?
- php - 您如何使用 Outlook 业务网络发送具有同一公司域的电子邮件?
- javascript - 表单数据 POST 与 Ajax POST