I'm struggling to properly align this form
https://i.sstatic.net/ZzKUp.png
My goal is to achieve a layout similar to this https://i.sstatic.net/lYxqi.png
The labels always end up in a different position than the input fields... how can I fix this?
This is the code I am currently using:
<div class="form-group col-xs-3 col-md-4" >
<label class="control-label col-md-4" >Rif: </label>
<div class="col-md-8">
<input type="text" name="rif" id="rif" class="form-control" />
</div>
</div>
[Additional divs and inputs...]
Is there a way to align these elements correctly without compromising the format? Any assistance would be appreciated.