1
How to position elements without breaking
I have a screen with some inputs
, am using bootstrap
and defining the sizes of the fields, but still they are broken as in the image below.
I need them to stay straight and with the Label
upon them.
Codigo Edit
<section class="content">
<form action="http://localhost:8080/qs/index.php/cartao/editar" id="frmcartao" method="post" accept-charset="utf-8">
<input type="hidden" name="seq_cartao" value="N" id="seq_cartao" />
<div class="row">
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<div class="row">
<div class="form-group">
<label for="matricula" class="col-md-2 control-label">Matricula*</label>
<div class="col-md-2">
<input type="text" name="matricula" value="" id="matricula" class="form-control" />
</div>
</div>
<br>
<input type="hidden" name="seq_matricula" value="" id="seq_matricula"/>
<div class="form-group">
<label for="chip" class="col-md-2 control-label">Chip</label>
<div class="col-md-2">
<input type="text" name="chip" value="" id="chip" maxlength="100" class="form-control" />
</div>
</div>
<div class="form-group">
<label for="data_cancelamento" class="col-md-2 control-label">Data de Cancelamento</label>
<div class="col-md-2">
<input type="text" name="data_cancelamento" value="" id="data_cancelamento" class="form-control" />
</div>
</div>
<div class="form-group">
<label for="cod_barra" class="col-md-2 control-label">Código de Barras*</label>
<div class="col-md-2">
<input type="text" name="cod_barra" value="" id="cod_barra" maxlength="50" class="form-control" />
</div>
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-default" onclick="document.location.href='http://localhost:8080/qs/index.php/cartao'">Cancelar</button>
<button type="submit" class="btn btn-warning pull-right">Confirmar</button>
</div>
</div>
</div>
</div>
</form> </section>
Edit
As you keep adding form-control
Face if possible enters the browser of a Ctrl+U and copies the HTML code already rendered. The way you posted it is complicated to answer you. Already with the code already loaded on the page becomes easier
– hugocsl
@hugocsl Opa, I edited the post and put it already rendered. sorry for the silly error.
– Guilherme Rigotti
Place inputs inside Divs: https://jsfiddle.net/zcog3snf/
– Sam
Guy here rendered well https://imgur.com/6dP7UNd, probably you are using some CSS a plus ai, or else it is the way you have assembled PHP that is not correct... The strange thing is that in your image you have two inputs ok and two wrong.... you’ve already checked what’s different between what’s wrong and what’s right?
– hugocsl
There’s nothing different between them @hugocsl
– Guilherme Rigotti
@Sam tried the following. <div class="form-group col-Md-2"> <label for="chip">Chip</label> <div> <input type="text" name="chip" value="" id="chip" maxlength="100" /> </div> </div> , but to no avail
– Guilherme Rigotti
Puts in your input
class="form-control"
take a look at the documentation https://getbootstrap.com/docs/3.3/css/#Forms– hugocsl
@hugocsl added a print and updated code showing how the form-control was
– Guilherme Rigotti