实际解决方式
html
<div class="form-group">
<label for="date">参观日期日期</label>
<input type="date" class="form-control" id="date"
placeholder="选择你有空的时间" onchange="dateAstrict(this)">
<small id="dateHelp" class="form-text text-muted">
<span style="color: red">*</span>请合理选择日期
</small>
</div>
样式
<style>
#date{
position: relative;
}
#date::-webkit-calendar-picker-indicator{
position: absolute;
right: 0;
padding-left: calc(100% - 10px);
padding-right: 10px;
}
</style>
这篇博客分享了如何在HTML5中实现一个时间选择器,通过调整样式使得输入框和图标点击都能触发日期选择对话框。示例代码包括HTML和CSS,旨在提升用户体验。
1210

被折叠的 条评论
为什么被折叠?



