user441521 user441521 - 2 years ago 129
HTML Question

vertical align html form

I'm looking to center this textbox and submit button on the page both vertically and horizontally but the following code just puts it in the top center. How can I center this to the page? It's like it's ignoring the vertical-align setting.

<div style="text-align:center; vertical-align:middle">
<form action="save_thought.php" method="post">
<input type="text" name="thought"><br>
<input type="submit" value="Submit">

Answer Source

You can use position:absolute DEMO

div#form-wrapper {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download