如何浮动输入框,以便在调整窗口大小时,元素并排放置。 当我调整窗口大小,使其变小,浮动密码输入框变为新行时,我遇到了问题。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<!-- start wrapper -->
<div class="wrapper">
<!-- start header -->
<div class="header">
<div class="Login">
<h1>User Login</h1>
<form name="Login" method="#" action="#">
<input type="text" value="User Name" />
<input type="password" value="password" />
</form>
<div class="links"><h3>Not yet a Member?</h3> <a href="">Register Now</a> <a href=""> <span>Login</span></a></div>
</div>
</div>
<!-- End header -->
<!-- Start main -->
<div class="main"></div>
<!-- End main -->
<!-- start footer -->
<div class="footer"></div>
<!-- End footer -->
</div>
<!-- End wrapper -->
/ * CSS * /
@charset "utf-8";
/* CSS Document */
/* CSS Reset */
ul,li,h1,h2,h3{padding:0;margin:0;}
ul{list-style:none;}
/* CSS for wrapper */
.wrapper{background:#fffde4 ;width:664px;height:789px;margin:0 auto;border:#000 thin groove;color:#bb9d59;padding:17px 28px 28px 35px;font-family:Arial, Helvetica, sans-serif; }
/* Header */
.header{width:664px;border:#000 thin groove;overflow:hidden;}
.Login{width:390px;border:#000 thin double;float:right;}
h1{margin-bottom:7px;border:#000 thin groove;color:#2c787b;font-size:27px;}
input[type="text"],input[type="password"]{width:172px;height:21px;color:#bb9d59;background- color:#f9f6d4;border:none;font-size:10px;padding-left:9px;float:left}
input[type="text"]{border:#000 thin groove;}
input[type="password"]{border:#000 thin groove;margin-left:15px;}