title: CSS with DIV checkbox, the input is not aligned to center of DIV
body: <p>I have a <code>checkbox</code> that I used in tables and other parts of my web application.</p>
  
  <p>This checkbox is inside a <code>DIV</code> so it has a nicer look and feel.</p>
  
  <p><a href="https://i.stack.imgur.com/XMtKJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XMtKJ.png" alt="enter image description here"></a></p>
  
  <p>This is how the checkbox is formed in <code>HTML</code>:</p>
  
  <pre><code>&lt;div class="checkbox checkbox-success checkbox-single"&gt;
     &lt;input type="checkbox"&gt;&lt;label&gt;&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have detected that when I click in the center of the checkbox it works but If I checked like on the very top left, top right or bottom left it doesn't work.</p>
  
  <p>Then I Inspect the element in <code>Google chrome</code> and found this when I select the <code>input</code> element.</p>
  
  <p><a href="https://i.stack.imgur.com/9RrQE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9RrQE.png" alt="enter image description here"></a></p>
  
  <p>That's why it not working because the input element is not centerd to the div.</p>
  
  <p>I'm using Bootstrap 3.</p>
  
  <p>Here are the <code>CSS</code> that I can see in the Google chrome inspector when I select the <code>input</code> element.</p>
  
  <p><a href="https://i.stack.imgur.com/FEGnP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FEGnP.png" alt="enter image description here"></a></p>
  
  <p>Here are the <code>CSS</code> that I guess are applyed from my <code>Style.css</code></p>
  
  <pre><code>.checkbox {
    padding-left: 20px;
  }
  .checkbox label {
    display: inline-block;
    padding-left: 5px;
    position: relative;
  }
  .checkbox label::before {
    -o-transition: 0.3s ease-in-out;
    -webkit-transition: 0.3s ease-in-out;
    background-color: #ffffff;
    border-radius: 3px;
    border: 1px solid #cccccc;
    content: "";
    display: inline-block;
    height: 17px;
    left: 0;
    margin-left: -20px;
    position: absolute;
    transition: 0.3s ease-in-out;
    width: 17px;
    outline: none !important;
  }
  .checkbox input[type="checkbox"] {
    cursor: pointer;
    opacity: 0;
    z-index: 1;
    outline: none !important;
  }
  .checkbox label::after {
    color: #555555;
    display: inline-block;
    font-size: 11px;
    height: 16px;
    left: 0;
    margin-left: -20px;
    padding-left: 3px;
    padding-top: 1px;
    position: absolute;
    top: 0;
    width: 16px;
  }
  .checkbox.checkbox-single label {
    height: 17px;
  }
  .checkbox-success input[type="checkbox"]:checked + label::before {
    background-color: #01ba9a;
    border-color: #01ba9a;
  }
  .checkbox-success input[type="checkbox"]:checked + label::after {
    color: #ffffff;
  }
  </code></pre>
  
  <p>Here is a <code>CodePen</code> sample, don't show the same exact position but you will see that input is not centered aligned.</p>
  
  <p><a href="http://codepen.io/anon/pen/Jbqapo" rel="nofollow noreferrer">http://codepen.io/anon/pen/Jbqapo</a></p>
  
  <blockquote>
    <p>This is breaking my head, any clue?</p>
  </blockquote>