0

I'm trying to make the form go to the center of the page but its just staying at the top of the page.

body {margin: 0}

.form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: gray;
}
<form class='form' method='POST' action='/users' id='register'>
  <h2>Register</h2>
  <label>Username</label>
  <input name='username' required>
  <label>Password</label>
  <input type='password' name='password' required>
  <button type='submit'>Submit</button>
</form>
VXp
  • 11,598
  • 6
  • 31
  • 46
icewizard
  • 133
  • 1
  • 13

0 Answers0