我有一个登录表单,并且有一个自定义图像按钮。出于某种原因,如果页面被刷新或重新加载,它有时会下移一行并弄乱格式。如果页面再次刷新,它会恢复正常。这种情况一遍又一遍地发生。我不知道是什么原因造成的。无论如何,这是我的表格和CSS。它被标记为 value=login。整个表格也在类“login_box.
登录表单代码:
<form action="process.php" method="POST">
<input type="text" placeholder="username" name="user" maxlength="30" size="16px" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
<input type="password" placeholder="password" name="pass" maxlength="30" size="15px" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
<input type="hidden" name="sublogin" value="1">
<div class="button"><input type="image" src="images/login.png" width="26px" onmouseout="this.src='images/login.png'" onmouseover="this.src='images/loginhover.png'" onmouseout="t value="Login"></div>
<br><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>>
<font size="2" color="#BDBDBD"> Remember Me
<div class="forgot"><font size="2"><a href="forgotpass.php">Forgot Password?</a></font></div>
<div class="New"><br><a href="register.php">New Member? Register Now!</a></div>
</form>
和整个表单的 css,按钮是 .button 类:
.login_box {
float:left;
margin-top:10px;
margin-right:-590px;
margin-left:35px;
list-style: none;
}
.login_box li {
}
.login_box li a {
color:#BDBDBD;
text-decoration:none;
padding-left:60px;
padding:0px;
}
.logged_in {
background-color:#585858;
border:2px solid#FFFFFF;
width:308px;
height:55px;
margin-left:-5px;
}
.welcome {
color:#B40404;
font-size:22px;
text-decoration:underline;
font-family:"Rockwell";
padding-left:10px;
}
.account {
list-style:none;
display:inline;
padding:0px;
font-size:13px;
text-decoration:underline;
margin-left:10px
}
.forgot {
display:inline;
padding-left:38px
}
.New {
padding-left:38px;
font-size:16px;
margin-top:-18px
}
.button {
display:inline;
float:right;
margin-left:1px;
position:absolute
}
.register_box {
float: center;
padding-left:100px
}