Javascript 如何对齐标签&;一行中的日期时间选择器
我试着让控件保持在同一条线上,但它不会落在同一条线上Javascript 如何对齐标签&;一行中的日期时间选择器,javascript,html,css,twitter-bootstrap-3,Javascript,Html,Css,Twitter Bootstrap 3,我试着让控件保持在同一条线上,但它不会落在同一条线上 <div class="form-group"> <div class="col-sm-3" style="float:left" ;> <div class="form-group"> Starts On : <div class=
<div class="form-group">
<div class="col-sm-3" style="float:left" ;>
<div class="form-group">
Starts On :
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class="col-sm-9">
<label>Ends</label>
<div class="form-group">
<label class="radio-inline"> <input type="radio" name="optradio">Never</label>
<label class="radio-inline"><input type="radio" name="optradio">After</label>
<input style="height:30px;width:50px" type="text" name="fname"> Occurances
<label class="radio-inline">
<input type="radio" name="optradio">On
</label>
<div class='input-group date' id='datetimepicker1' style="width:150px;">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
开始日期:
末端
从未
之后
发生
在…上
我必须在单选按钮上显示右侧的日期时间选择器。我希望这就是你要找的 代码
开始日期:
末端
从未
之后
发生
在…上
工作
确保您的项目中的u-link引导正确因为您没有提供任何CSS,设置
display:inline block如何包含元素的
上的code>?这就是为什么人们不使用引导程序的原因-它最终会变得一团糟。这应该是一个带有
和
的
,仅此而已。实际上,根本不需要
s。另外,用浏览器检查css。你会看到类col-sm-3
已经分配了float:left
,所以这是多余的/重复的(通常使用内联样式是不好的做法):
@junkfoodjunkie-虽然我实际上不是一个超级引导迷,但使用它并没有什么错,也不需要弄得一团糟,事实上它为不存在或不应该存在的问题提供解决方案,并且在大多数情况下,鼓励在每个元素上使用特定于样式的类,通常是一堆。如果您知道自己在做什么,它通常还会添加一堆完全不需要的HTML包装。这是一个拐杖,而且在这方面很糟糕。
<div class="form-group">
<div class="col-sm-3" style="float:left" ;>
<div class="form-group">
Starts On :
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class="col-sm-9">
<label>Ends</label>
<div class="form-group">
<label class="radio-inline"> <input type="radio" name="optradio">Never</label>
<label class="radio-inline"><input type="radio" name="optradio">After</label>
<input style="height:30px;width:50px" type="text" name="fname"> Occurances
<label class="radio-inline">
<input type="radio" name="optradio">On
</label>
<div class='input-group date' id='datetimepicker1' style="width:150px;">
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>