title: Centering a form horizontally and vertically
body: <p>I have looked for a solution to this for around half a day. I am just starting web design and I need to center a form horizontally and vertically. Right now it is in the top left-hand corner. Please do not mind the bad code I am going to tidy it up soon.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>form {
   
      display: table-cell;
     text-align: center;
     vertical-align: middle;
      
  }
  
  
  .trans {
      
      background:rgba(1,1,1,0.6);
      
  }
  
  body {
      
    background-image: url(wallpaper.jpg);     
      
  }
  
  .text {
      
  
      
  }
  
  .box {
      
      display: table;
      width: 100%;
      
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
          &lt;link rel="icon" type="image/ico" sizes"32x32" href="pths_logo32x.png"&gt;
          &lt;title&gt;Peq Anon&lt;/title&gt;
          
      &lt;/head&gt;
      
      &lt;body&gt;
  
          &lt;div class="container"&gt;
              &lt;form&gt;
                  &lt;input class="trans text" type="text" name="Password"&gt;
                  &lt;button type="submit" onclick="#"&gt;Submit&lt;/button&gt;    
              &lt;/form&gt;    
          &lt;/div&gt;
          
          
          
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>