Link to home
Start Free TrialLog in
Avatar of rp
rpFlag for Portugal

asked on

css center page horizontally

I have several elements, but is left-aligned, how can center on page horizontally.
SOLUTION
Avatar of Eyal
Eyal
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Kiran Sonawane
Kiran Sonawane
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rp

ASKER

I do not know how or why but the problem was in this style, not allow center other elements:

form {                  
      width: 420px;
}
If your entire page is enclosed in a <form> tag, then the width of that form will dictate the relative centering position of the enclosed elements.
Do you mean its form elements for user input that you want centered?