I'm new to web design, searching the web I found the bootstrap framework and it seemed super...but I tried to design a form like the one in the image and I couldn't find the way to do it .
With the help of some people in this forum I was able to align the two text boxes with Bootstrap, but I couldn't make them more united to give the form more uniformity, how could this be achieved?
Patient Entry Identification Type Identification Number First Name Middle NameFirst Surname Second Surname Sex Male Female Date of Birth Marital StatusSingle Married Occupation Address Landline PhoneCell Email CityDepartment Regime Type of Affiliate Contributor Additional Beneficiary EPSRank 1 2 3 Not Applicable SubmitSendSend</div>
Untitled document
<body>
<div class="container">
<br>
<br>
<br>
<div class="panel panel-primary">
<div class="panel-heading">Ingreso de Pacientes</div>
<div class="panel-body">
<form id="form" class="form-horizontal "role="form">
<div class="row">
<div class="form-group col-md-6">
<label for="ejemplo_email_3" class="col-lg-5 control-label" name="nombre">Primer Nombre</label>
<div class="col-lg-5">
<input type="text" class="form-control" name="text_nom1" id="text_nom1" required/>
<span class="help-block"></span>
</div>
</div>
<div class="form-group col-md-6">
<label for="ejemplo_email_3" class="col-lg-5 control-label">Segundo Nombre</label>
<div class="col-lg-5">
<input class="form-control" name="text_nom2" id="text_nom2">
</div>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="ejemplo_email_3" class="col-lg-5 control-label">Primer Apellido</label>
<div class="col-lg-5">
<input class="form-control" name="text_ape1" id="text_ape1">
</div>
</div>
<div class="form-group col-md-6">
<label for="ejemplo_email_3" class="col-lg-5 control-label">Segundo Apellido</label>
<div class="col-lg-5">
<input class="form-control" name="text_ape2" id="text_ape2">
</div>
</div>
</div>
<div class="row">
<div class="form-group form-inline col-md-6">
<label for="ejemplo_email_3" class="col-lg-5 control-label">Ciudad</label>
<div class="col-lg-2">
<input class="form-control" id="ejemplo_password_3" name="text_ciu" id="text_ciu">
</div>
<div class="col-lg-3">
<input class="form-control" id="ejemplo_password_3" name="text_ciu" id="text_ciu">
</div>
</div>
<div class="form-group col-md-6">
<label for="ejemplo_email_3" class="col-lg-5 control-label">Departamento</label>
<div class="col-lg-5">
<input class="form-control" id="ejemplo_password_3" name="text_dep" id="text_dep">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-2 text-center">
<div class="btn-group" data-toggle="buttons">
<button type="button" id="btn_enviar" class="btn btn-primary">Enviar</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
You need to understand how columns work, how they are nested, and how they are given different dimensions depending on the width of the browser.
You were close to getting it!
In each column you can combine the sizes
col-xs-1/12
,col-sm-1/12
,col-md-1/12
andcol-lg-1/12
to achieve the desired structure.In this particular case, without going deeply into modifying the
css
original ofbootstrap
to adjust the separation between elements, you would need something like this:But by default,
bootstrap
it aligns the labelslabel
to the right margin.With a line
css
and indicating aid
custom to the form ( so that it does not affect other forms ) it is solved.I recommend you take a look at http://bootsnipp.com/forms where it helps you to generate the
HTML
necessary form usingdrag and drop
,controles
based on this website we have the following (vertical):Also at http://bootsnipp.com/ you can find various examples based on Bootstrap. Finally here are a couple of good tutorials explained step by step:
https://www.tutorialspoint.com/bootstrap/index.htm
http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/
Although in English -> with a translator you do it or learn the language in:
http://www.memrise.com
http://www.duolingo.com
http://www.engvid.com
I hope you find it useful :D
bootstrap is based on a column layout: at the following url you can find the information to get started http://getbootstrap.com/getting-started/
In short, you have 12 columns to spread the content of the pages. So there would be many ways to replicate the form you share. For example, one of the forms would be the following:
Note that the total of the columns with class col-xs-3 adds up to 12 columns, where the number 3 indicates the number of columns. Since col-xs-3 is 4 times, that's where the total of 12 columns is added.
The important thing about bootstrap is to modify the number of columns that a content uses depending on the screen resolutions, so I recommend that you use the documentation in the link that I share so that you learn how to use the tool properly.
Greetings.