tags:

views:

88

answers:

1

I want to position a registration from at the center of a page.

please tell me how should i do that

+1  A: 

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>
Wayne Hartman
add on: use XHTML 1.0 transitional. Also to shorten it: `margin:0px auto;`
thephpdeveloper
You would also need `text-align:center` on your body/div to centre it in the page correctly, it's not enough just having the margins as auto.
James
thanks a lot .what about the top and bottom margins ??? the above code places the form at the very top of the page /
lakshmanan
You can do `margin: 10px auto 0 auto;` and it will do the same but with extra space at the top of the page.
James
You can certainly add the bottom and top margins. It's the left and right margins that will horizontally center it.
Wayne Hartman