Correct this CSS code

Trying to put the form at the center.

#form-div{
display:block;
text-align:center;
position:relative;
left:300px;
right:300px;
}

Have you tried margin auto? If not remove left, right and do margin: 0 auto; to center it horizontally only.

1 Like

Thanks. It worked.
Can you please explain it

I believe this guide should make it clear enough…