在bootstrap 2中,建议在表单中排列标签和只读文本字段的方法。以下代码示例创建未对齐的字段:
@H_403_2@<form class="form-horizontal">
<fieldset>
<legend>Sample</legend>
<div class="control-group">
<label class="control-label">Readonly Field</label>
<div class="controls">
Lorem Ipsum and then some
</div>
</div>
</fieldset>
</form>
注意,我可以自己修复这个自定义CSS。这不是问题。它只是似乎愚蠢,这不是内置的,所以我觉得我一定要俯瞰的东西。
解决方法
您可以使用不可编辑的输入
@H_403_2@<span class="input-xlarge uneditable-input">Lorem Ipsum and then some</span>
编辑:
从Bootstrap 3.0开始,已经添加了一个类来处理这个问题
@H_403_2@<div class="controls"> <p class="form-control-static">Lorem Ipsum and then some</p> </div>When you need to place regular,static text next to a form label
within a horizontal form,use the.form-control-static
class on a<p>