gpt4 book ai didi

html - 使用 bootstrap 3 在同一行上获取两个日期时间选择器?

转载 作者:搜寻专家 更新时间:2023-10-31 08:18:52 24 4
gpt4 key购买 nike

我正在使用 eonasdan datetimepicker 和 bootstrap 3。我有一个 datetimepicker 设置为日历,另一个设置为时间。我希望能够将它们并排放在同一条线上。但如果不破坏 datetimepicker,我就无法完全弄明白。这是我的代码:

<form role="form">
<div class="form-group">

<div class="form-group">
<label for="class">Class:</label> <select multiple
class="form-control" size="2">
<option value="1">Class 1</option>
<option value="2">Class 2</option>
</select>
</div>

<div class="form-group">

</div>

<div class="form-group">
<!-- Date Picker -->
<div class="input-group date" id="startDate">
<input type='text' class="form-control" /> <span
class="input-group-addon"><span
class="glyphicon glyphicon-calendar"></span> </span>
</div>
</div>
<div class="form-group">
<!-- Time Picker -->
<div class="input-group date" id="startTime">
<input type='text' class="form-control" /> <span
class="input-group-addon"><span class="glyphicon glyphicon-time"></span>
</span>
</div>

</div>


<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>

And here is a JSFiddle where the date picker doesn't work but other than that OK .出于某种原因,我也不能强制多选只有 2 行高?

最佳答案

这似乎是一个 css 问题,可以覆盖。将 datepickerTimepicker 放在一个 div 中,例如

<div class="form-group">
<!-- Date Picker -->
<div class="input-group date " id="startDate">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
<!-- Time Picker -->
<div class="input-group date" id="startTime">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>

然后使用 CSS:

#startDate, #startTime {
width: 50%;
float: left;
}

enter image description here

注意:使用 % 宽度值以保持其响应

JSFiddle

关于html - 使用 bootstrap 3 在同一行上获取两个日期时间选择器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21401415/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com