这是注册表单.php
<?php
?>
<html>
<head>
<title>Registration Form</title>
<link href="register.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id = "everything">
<div id = "header">
Register
</div>
<div id = "content">
<div id = "regside">
<form name="register" action="success.php" method="get" >
Username: <input name="username" type="text" maxlength="30" /><br><br>
Password: <input name="password" type="password" maxlength="30" /><br><br>
Confirm Password: <input name="cpassword" type="password" maxlength="30" /><br><br>
Lastname: <input name="lastname" type="text" maxlength="30" /><br><br>
Firstname: <input name="firstname" type="text" maxlength="30" /><br><br>
Middlename: <input name="middlename" type="text" maxlength="30" /><br><br>
Email Address: <input name="eemail" type="text" maxlength="30" /><br><br>
<input name="register" type="submit" value="Register" style = "width:100px; height:50px;" />
</form>
</div>
<div id = "other">
</div>
</div>
<div id = "footer">I am another footer :D</div>
</div>
这是我的CSS
body{
background-color:#C1F4F4;
height:600px;
width:800px;
float:center;
margin:auto;
padding-top:20px;
}
#everything{
-moz-border-radius: 15px;
border-radius: 15px;
background-color:#000;
float:center;
margin:auto;
overflow:hidden;
}
#header {
text-align: center;
color:#FFF;
font-size: 20px;
height:30px;
padding:10px;
}
#content{
background-color:#E6F2F2;
height:500px;
width:100%;
}
#regside{
color:#000;
float:right;
width:40%;
height:500px;
text-align: right;
padding: 20px;
}
#other{
background-image:url(photos/anime.png);
background-repeat:no-repeat;
background-size:100%;
height:500px;
width:50%;
float:left;
}
#footer{
color:#FFF;
height:10px;
width:100%;
margin: auto;
padding:10px;
text-align: center;
}
出于某种原因,我找不到它的页脚文本没有居中。看起来它以 为中心,#other
但两者都#other
属于#footer
并且#content
不#other
应该能够影响#footer
。