0
I need to do the following: Label above and control below the Abels. I took the example of the page itself twitter bootstrap
and it’s not working. Below my code:
<div id="tabs-1">
<form role="form"><!--A tag ul contem os titulos das abas-->
<div class="form-group">
<div class="form-group">
<label for="txtCnpjPdv" >CNPJ/Razão Social:</label>
<input type="text" class="form-control;col-sm-2" id="txtCnpjPdv" placeholder="Digite o Cnpj">
@*</div>
<div class="form-group">*@
<label for="txtContato" >Contato:</label>
<input type="text" class="form-control;col-sm-2" id="txtContato" placeholder="Digite o Cnpj">
@*</div>*@
<label for="ddlFiltrarRede" class="col-sm-2 control-label">Filtrar Rede:</label>
@*<div class="col-sm-3">*@
<select class="form-control;col-sm-2" name="ddlTipoEvento" id="ddlFiltrarRede" >
<option value="SemFiltro">Sem Filtro</option>
<option value="Associativa">Associativa</option>
<option value="Franquia">Franquia</option>
<option value="Propria">Própria</option>
</select>
@*</div>*@
<label for="ddlFiltrarStatus" class="col-sm-2 control-label">Filtrar Status:</label>
@*<div class="col-sm-3">*@
<select class="form-control;col-sm-2" name="ddlTipoEvento" id="ddlFiltrarStatus" >
<option value="SemFiltro">Sem Filtro</option>
<option value="Ok">Ok</option>
<option value="Atençao">Atenção</option>
<option value="Erro">Erro</option>
<option value="NaoCadastrado">Não Cadastrado</option>
<option value="Desativado">Desativado</option>
</select>
@*</div>*@
<label for="ddlFiltrarVisao" class="col-sm-2 control-label">Visão:</label>
@*<div class="col-sm-3">*@
<select class="form-control;col-sm-2" name="ddlTipoEvento" id="ddlFiltrarVisao" >
<option value="Geral">Geral</option>
<option value="SouzaCruz">Souza Cruz</option>
</select>
@*</div>*@
</div>
</div>
</form>
</div>
If I remove this part of the select controls(class="col-sm-2 control-label"
), is all on the same line. What I want is label on top and control on the bottom.
It didn’t work because the controls were width=100% and this doesn’t work. Is there any way I can decrease the size? The only way was the way I had done it. All the Abels must be on the same line and all the controls are on the same line below the Abels.
– pnet
@pnet thus meaning ? http://jsfiddle.net/R9vT5/1/
– abfurlan
I need to align the Labels in the same line and also the controls, below the Labels, corresponding to each label, obvious. That’s my need. I’m having a hard time working with bootstrap, simple things like this.
– pnet
@pnet plus that, the way I sent it, if it’s not, put an image to exemplify it, it’s easier to understand.
– abfurlan
@pnet you can increase a column instead of
col-xs-2 col...2
placecol-xs-3 col...3
, the sum of all columns has to be 12, see if this solves– abfurlan
It didn’t work. If I put Filter/Status, then it works, because it only considers one word. When there are two it breaks.
– pnet
@pnet in the CSS
label {white-space:nowrap;}
– abfurlan
Now yes, the post is closed. Thank you very much @abfurlan. It did work that way.
– pnet