我已经从bootstrap中复制并粘贴了示例代码。我已经包含了bootstrap CSS和JS文件& jQuery库。 Base CSS - Bootstrap
由于某些原因,标签和输入字段显示为内联。有人可以看看我做错了吗?
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="inputEmail">Email</label>
<div class="controls">
<input type="text" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
<input type="password" id="inputPassword" placeholder="Password">
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox"> Remember me
</label>
<button type="submit" class="btn">Sign in</button>
</div>
</div>
</form>
答案 0 :(得分:0)
尝试使用.form-group而不是.control-group class。
请记住在表单标记之后使用.col - - *类设置容器。
实施例
<form class="" role="form" method="POST" action="{form_action}" onsubmit="return ValidateForm()" enctype="multipart/form-data">
<div class="col-sm-6 col-md-6">
<div class="form-group">
<label class="control-label label-fw">Vendida? </label>
{chk_sold}
</div><!-- form group -->
<div class="form-group">
<label for="txt_title" class="control-label label-fw">Título </label>
<input name="txt_title" type="text" class="form-control input" id="txt_title" value="{txt_title}" placeholder="titulo del producto">
</div><!-- form group -->
<div class="form-group">
<label for="txt_title" class="control-label label-fw">Categoría </label>
{cbo_type}
</div><!-- form group -->
<div class="">
<label for="txt_aution_date_d" class="control-label label-fw">Fecha </label>
<input name="txt_auction_date_d" type="text" class="form-control" id="txt_auction_date_d" value="{txt_auction_date_d}" placeholder="MM/DD/AAAA">
</div><!-- form group -->
</div><!-- col-sm-6 col-md-6 -->
</form>
如果有效,请告诉我。