[ACCEPTED]-How to position an input form at the center of a page?-css

Accepted answer
Score: 11

Encapsulate it in a div with the following 1 CSS attributes:

<div style="width:400px; margin-right:auto; margin-left:auto; border:1px solid #000;">
    <form action="helloWorld">
        <Some markup>
Score: 2

Just use:

<div style="margin:0 auto" align=center>
 <input button>


Score: 1

I created a .CSS file with the following:

form {width: 40%;
      margin-right: 30%;
      margin-left: 30%;
      background-color: green}

div.mainform {width:100%;
              border:1px solid #000}

Then 1 in the HTML document I used.

        Other HTML Markup

More Related questions