1
I have difficulty positioning controls, like: I have a Textarea and I would like to put a label next to it, next to the bottom right and below the label, a SELECT control.
Well I have managed, but like this, giving top and left with numerical values, which I do not like much, due to the inconsistencies of the browsers. There is a more practical, more reliable way to position yourself without having to numerically fix the control?
I put an image and this image is slightly below the label, it makes me have an extra space between one and the other. See the full code below.
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="lblCnpj" class="col-md-2 control-label">CNPJ:</label>
<div class="col-md-4">
<input type="text" class="form-control" id="txtCnpj" placeholder="Digite o Cnpj">
</div>
<label for="lblStatus" class="col-md-2 control-label">Status:</label>
<div class="col-md-4">
<img src="~/Images/Certo.png" class="col-md-2 control-label"/>
</div>
</div>
<div class="form-group">
<label for="lblRazao" class="col-md-2 control-label">Razão Social:</label>
<div class="col-md-6">
<input type="text" class="form-control" id="txtRazaoSocial" placeholder="Digite a razão social">
</div>
</div>
<div class="form-group">
<label for="lblIdEvento" class="col-md-2 control-label">ID Evento:</label>
<div class="col-md-2">
<input type="text" class="form-control" id="txtIdEvento" placeholder="Digite um evento">
</div>
</div>
</form>
So, but how do I do with CSS in this case?
– pnet
Do I need to install the bootstrap? I went to run this example, and so far ok, now the hard part will be how to position a Textarea and next to it in the bottom right, position more controls.
– pnet
You need to study the Bootstrap grids scheme to know how to use correctly. Lose about 3 days of work and dedicate yourself to it, the subsequent productivity gain will be rewarding.
– Tiago César Oliveira
Bootstrap is a CSS library, just use it! They have CDN links on the site
– Tiago César Oliveira
I’m starting to wear it. I’m just having a hard time putting one control next to the other and I couldn’t put the label on top and the textbox just below. But I need to read more, three days in four hours, that’s my time.
– pnet