title: Put a Bootstrap 3 div inside a centered div to center
body: <p>I have a code like this-</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html, body, .container-table {
    height: calc(100% - 50px);
  }
  
  /*Making a div in center*/
  
  .container-table {
    display: table;
  }
  .vertical-center-row {
    display: table-cell;
    vertical-align: middle;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"&gt;&lt;/script&gt;
  
  
  &lt;div class="container container-table"&gt;
    &lt;!-- Main div to hold all Data --&gt;
  
    &lt;!-- Login Form --&gt;
    &lt;div class="row vertical-center-row"&gt;
  
      &lt;h2 class="text-center"&gt;Login&lt;/h2&gt;
      &lt;form class="form-horizontal" action="login.html"&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="inputEmail" class="control-label col-md-2"&gt;Email&lt;/label&gt;
          &lt;div class="col-md-4"&gt;
            &lt;input name="email" type="email" class="form-control" placeholder="Email" required&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="inputPassword" class="text-center control-label col-md-2"&gt;Password&lt;/label&gt;
          &lt;div class="col-md-4"&gt;
            &lt;input name="password" type="password" class="form-control" placeholder="Password" required&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          &lt;div class="col-md-offset-2 col-md-4"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label&gt;
                &lt;input type="checkbox"&gt;Remember me&lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;button name="remember_me" type="submit" class="center-block btn btn-primary"&gt;Sign in&lt;/button&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So, I am getting a output like this-</p>
  
  <p><a href="https://i.stack.imgur.com/Kcptq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kcptq.jpg" alt="enter image description here"></a></p>
  
  <p>But I want to have it like this-</p>
  
  <p><a href="https://i.stack.imgur.com/Y0KcG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y0KcG.jpg" alt="enter image description here"></a></p>
  
  <p>Can anyone please help?</p>
  
  <hr>
  
  <h2>Re-</h2>
  
  <p>This Question-</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/34588593/centering-login-form-bootstrap">Centering Login Form Bootstrap</a></p>
  </blockquote>
  
  <p>Is not a solution for my problem, because if u run the codes given and read the requirements, then u can easily find this.</p>
  
  <p><strong>More</strong>- My problem is not centering a div, My problem is centering a div inside of a div which is already centered horizontally and vertically.</p>