Its my beginning with Twitter Bootstrap so that question might be quite silly, but I’ve no idea how to solve that issue. I want to put checkbox and radiobutton in same row (should be displayed vertically aligned) but checkboxes and radiobuttons should be grouped in two separated fieldsets. I’ve got something like that: html snippet
but checkboxes are displayed higher than radiobuttons and putting them in the same div doesn’t change anything.
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<div class="row">
<div class="col-md-2">
<fieldset>
<legend>
<h6>RB:</h6>
</legend>
<div class="row">
<div class="radio">
<label>
<input type="radio" name="optradio">Option 1</label>
</div>
</div>
<div class="row">
<div class="radio">
<label>
<input type="radio" name="optradio">Option 1</label>
</div>
</div>
</fieldset>
</div>
<div class="col-md-1">
<fieldset>
<legend>
<h6>CB:</h6>
</legend>
<div class="row">
<input type="checkbox" value="">
</div>
<div class="row">
<input type="checkbox" value="">
</div>
</fieldset>
</div>
</div>
</div>
2
Answers
This is how I did it:
Have a look at the JSFiddle demo
You could use the inline form class here
or you could wrap your checkbox inputs with the checkbox class like this: