3

I've been trying lots of ways to put a <input type="checkbox" id="123"/> infront of a label, but they're leaving a huge gap between theirselves. Any workaround? Here's my html:

<div class="row">
    <div class="col-sm-6">
        <div class="input-group input-group-sm">
            <input type="checkbox" id="ProcessingConsultantYN" value="0" />
            <label class="input-group-addon input-group-addon-pireus" aria-describedby="ProcessingConsultantYN" id="lbProcessingConsultant" for="ProcessingConsultantYN">Обработва се от Кредитен Консултант</label>
        </div>
    </div>
</div>

Here's how it looks when being displayed on the website and what I actually want to fix: enter image description here

Suneel Kumar
  • 1,560
  • 1
  • 18
  • 28

4 Answers4

8

Try below Code Just replace your label tag class with checkbox-inline.

<div class="row">
  <div class="col-sm-6">
    <div class="input-group input-group-sm">
      <input type="checkbox" id="ProcessingConsultantYN" value="0" />
      <label class="checkbox-inline" aria-describedby="ProcessingConsultantYN" id="lbProcessingConsultant" for="ProcessingConsultantYN">Обработва се от Кредитен Консултант</label>
    </div>
  </div>
</div>
Carl Binalla
  • 5,153
  • 5
  • 25
  • 44
Shubham Baranwal
  • 2,333
  • 2
  • 12
  • 23
1

Try with this code. under the label, tag use your checkbox tag as per BOOTSTRAP official doc, or you can modify the structure what ever you want.

I just simply try to make an option with form-control you can use .form-control-static class as per Static control

<!-- Latest compiled and minified CSS -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <div class="row">
      <div class="col-sm-6">
        <div class="checkbox">
          <label> <input type="checkbox"> Обработва се от Кредитен Консултант </label>
        </div>
        
        <div class="input-group">
          <span class="input-group-addon" id="basic-addon1"><input type="checkbox" id="ProcessingConsultantYN" value="0" /></span>
          <label class="form-control">Обработва се от Кредитен Консултант</label>
        </div>
        
      </div>
    </div>
Zaid Bin Khalid
  • 600
  • 4
  • 19
1

How to align checkboxes and their labels consistently cross-browsers

label {
  display: block;
  padding-left: 15px;
  text-indent: -15px;
}
input {
  width: 13px;
  height: 13px;
  padding: 0;
  margin:0;
  vertical-align: bottom;
  position: relative;
  top: -1px;
  *overflow: hidden;
}

AS @dfsq said check if something wrong or not in HTML inspector. Check the above link if it works or not.This link should sure help you. check jsfiddle

opalfire
  • 91
  • 1
  • 9
0

class pull-left should suffice for you.

<div class="row">
  <div class="col-sm-6">
    <div class="input-group input-group-sm">
      <input type="checkbox" id="ProcessingConsultantYN" value="0" />
      <label class="pull-left" aria-describedby="ProcessingConsultantYN" id="lbProcessingConsultant" for="ProcessingConsultantYN">Обработва се от Кредитен Консултант</label>
    </div>
  </div>
</div>
ScanQR
  • 3,542
  • 1
  • 10
  • 27