gpt4 book ai didi

twitter-bootstrap - Bootstrap 形式组间距

转载 作者:行者123 更新时间:2023-12-03 10:54:46 26 4
gpt4 key购买 nike

我想在控件之间留一些间距。根据规范,它应该使用表单组类来实现。但是,它不适用于我的情况。

http://jsfiddle.net/TLF4L/

<div class="col-xs-12 col-sm-12">
<form role="form">
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpTitle">Title</label>
</div>
<div class="col-xs-9">
<input type="text" class="form-control" placeholder="Title of the program" id="cpTitle" />
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpDesc">Description</label>
</div>
<div class="col-xs-9">
<textarea class="form-control" rows="3" placeholder="Description of the program" id="cpDesc"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpAddr">Program address</label>
</div>
<div class="col-xs-9">
<input type="text" class="form-control" placeholder="Name of Facility" id="cpAddr" />
<input type="text" class="form-control" placeholder="Street 1" />
<input type="text" class="form-control" placeholder="Street 2" />
<div class="col-xs-4">
<input type="text" class="form-control" placeholder="State" />
</div>
<div class="col-xs-4">
<input type="text" class="form-control" placeholder="City" />
</div>
<div class="col-xs-4">
<input type="text" class="form-control" placeholder="Zip" />
</div>
</div>
</div>
</form>
</div>

最佳答案

http://jsfiddle.net/TLF4L/6/

主要问题是确保您在表单上设置类“form-horizo​​ntal”。对于程序地址字段,您可以为每个字段设置单独的行,或者我建议只是在每个输入字段上为 margin-bottom 添加一个 CSS。上面编辑的jsfiddle

.margin-bottom {
margin-bottom:15px;}



<div class="col-xs-12 col-sm-12">
<form role="form" class='form-horizontal'>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpTitle">Title</label>
</div>
<div class="col-xs-9">
<input type="text" class="form-control" placeholder="Title of the program" id="cpTitle" />
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpDesc">Description</label>
</div>
<div class="col-xs-9">
<textarea class="form-control" rows="3" placeholder="Description of the program" id="cpDesc"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpAddr">Program address</label>
</div>
<div class="col-xs-9">
<input type="text" class="form-control margin-bottom" placeholder="Name of Facility" id="cpAddr" />
<input type="text" class="form-control margin-bottom" placeholder="Street 1" />
<input type="text" class="form-control margin-bottom" placeholder="Street 2" />
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">&nbsp;</div>
<div class="col-xs-3">
<input type="text" class="form-control" placeholder="State" />
</div>
<div class="col-xs-3">
<input type="text" class="form-control" placeholder="City" />
</div>
<div class="col-xs-3">
<input type="text" class="form-control" placeholder="Zip" />
</div>
</div>
</form>

关于twitter-bootstrap - Bootstrap 形式组间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23614338/

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