How to set gravity of all content in a div to center?

It’s unclear what you want exactly as your question is a little ambiguous.

As others have said above you can centre the inputs and the button by simply applying text-align:center to the parent.

e.g.

#loginForm{
  text-align:center;
}

If you don’t want the text centred in the input then reset the text to left on the inputs.

e.g.

#loginForm input{
  text-align:left;
}

If you are talking about vertical centering then that’s a more complicated scenario and will depend on a number of factors.

If you want all three items on one line but centred then remove the breaks you added.

It will help if you give as much information as possible when asking a question so we don’t have this guessing to and fro :slight_smile:

2 Likes