To center an item horizontally using CSS, add a div with a specific width and margin: 0 auto. Unfortunately, there isn't a quick fix for vertically centering a page.
<div style="width: 500px; margin: 200px auto 0 auto;">
<form action="login.php" method="post">
Username: <input type="text" id="txtusername" /><br />
Password: <input type="text" id="txtpassword" /><br />
<input type="submit" value="login" />
</form>
</div>
One option is to use position:fixed, but I recommend adjusting the margin-top instead, as shown in the example above.
Check out this JSFiddle example for reference. Enjoy!
Just a tip: the values for the margin property are margin: [top] [right] [bottom] [left], which explains the 200px for top, 0px for bottom, and auto for left and right.