I have a login page and I want to center it both horizontally and vertically.
I have written this code but it's not working.

**HTML:**

```
 <div class='loginMainDiv'>
  <div class="loginTable">
  </div>
</div>

```

**CSS:**

```
.loginMainDiv {
    height:550px;
    width:100%;
    text-align:center;
}

.loginTable {
   display: block;
  margin-left: auto;
  margin-right: auto;
}

```