Reputation: 25997
I want to create a form and have a checkbox next to it. Currently, it looks like this:
So, the checkbox aligns with the form's label i.e. they are aligned at top but I would like to have both aligned at bottom.
How should this be done?
This is my code:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="header">
<h3 class="text-muted">Select something!</h3>
</div>
<div class="row">
<div class="form-group col-xs-6">
<label for="some_selection">Select something</label>
<select class="form-control" id="some_selection">
<option selected>--None--</option>
<option>foo</option>
<option>bar</option>
</select>
</div>
<div>
<input class="form-check-input" type="checkbox" value="" id="some_id">I should be far lower
</div>
</div>
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
Upvotes: 1
Views: 70
Reputation: 2024
Try this
<div class="container">
<div class="header">
<h3 class="text-muted">Select something!</h3>
</div>
<div class="row">
<div class="form-group col-xs-12">
<label for="some_selection">Select something</label>
</div>
<div class="col-xs-6">
<select class="form-control" id="some_selection">
<option selected>--None--</option>
<option>foo</option>
<option>bar</option>
</select>
</div>
<div class="col-xs-6">
<input class="form-check-input" type="checkbox" value="" id="some_id">I should be far lower
</div>
</div>
</div>
Upvotes: 2