How to place the input form in the center of the page?

I want to place the registration in the center of the page.

please tell me how to do it

+5
source share
3 answers

Encapsulate it in a div with the following CSS attributes:

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

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 in the HTML document that I used.

<DIV ID="MAINFORM">
    <FORM>
        Other HTML Markup
    </FORM>
</DIV>
+1
source

Just use:

<div style="margin:0 auto" align=center>
 <input button>
</div>
+1
source

All Articles