RockBoro
RockBoro

Reputation: 2473

how center a checkbox underneath label using bootstrap?

in a bootstrap form, the checkbox appears off to the right and the label is to the left. How to center the checkbox under the label?

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<form>
  <div class="form-row">
  <div class="form-group col-md-2">
    <label for="isNewPrice">New price?</label>
    <input type="checkbox" class="form-control" id="isNewPrice" >
  </div>
</div>
</form>

Upvotes: 0

Views: 1976

Answers (1)

BENARD Patrick
BENARD Patrick

Reputation: 30975

Maybe with a text-center class ?

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<form>
  <div class="form-row">
  <div class="form-group col-md-2 text-center">
    <label for="isNewPrice">New price?</label>
    <input type="checkbox" class="form-control" id="isNewPrice" >
  </div>
</div>
</form>

Upvotes: 1

Related Questions