首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使整个HTML日期字段可点击?

如何使整个HTML日期字段可点击?
EN

Stack Overflow用户
提问于 2021-06-14 08:33:15
回答 1查看 1.8K关注 0票数 1

我在注册表单中使用HTML日期字段,我使用Laravel 7来制作我的应用程序。在我的“注册”刀片视图中,我有一个HTML日期字段,希望在单击整个日期部分时打开日历。我怎样才能做到这一点?现在,当单击小日历图标时,日历将打开。请帮帮忙。

我认为:

代码语言:javascript
运行
复制
<div class="col-sm-4 col-lg-4 col-md-4">
<label for="start_date">Start Date</label><span class="required">*</span>
<input type="date" class="form-control" id="start_date"  name="start_date" value="{{ old('start_date') }}" required>                            
</div>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-14 08:51:22

您可以实现如下所需的功能。

代码语言:javascript
运行
复制
<style>
.form-control input {
    border: none;
    box-sizing: border-box;
    outline: 0;
    padding: .75rem;
    position: relative;
    width: 100%;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}
</style>

<div class="col-sm-4 col-lg-4 col-md-4">
<label for="start_date">Start Date</label><span class="required">*</span>
<input type="date" class="form-control" id="start_date"  name="start_date" value="{{ old('start_date') }}" required>                            
</div>

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67967129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档