I'm struggling to align my form both vertically and horizontally.
It's okay if this doesn't work on IE - I will include an IE detection script to prompt users to switch browsers. However, Firefox and Chrome support is essential.
Below is my current setup:
HTML
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="global.css">
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div id="wrapper">
<div id="logo_div">
<img src="../images/logo.png" id="logo">
</div>
<div id="login">
<form name="searchform" action="checklogin.php" method="post" id="login_form">
<br>
User Name : <input type="text" name="myusername" size="16" /><br>
Password : <input type="password" name="mypassword" /><br>
<input type="submit" value="Login" /><br>
</form>
</div>
</div>
</div>
</body>
</html>
Global CSS
#wrapper {
position: relative;
max-width: 1024px;
height: 1000px;
margin-left: auto;
margin-right: auto;
}
#logo_div {
position: relative;
margin-left: auto;
margin-right: auto;
}
#logo {
display: block;
position: relative;
margin-left: auto;
margin-right: auto;
}
Index CSS
#login {
position: relative;
margin-left: auto;
margin-right: auto;
}
#login_form {
position: relative;
margin-left: auto;
margin-right: auto;
}
If you have any tips or advice, please share. Thank you!