【发布时间】:2015-06-29 21:32:28
【问题描述】:
我想更改我的主 HTML 页面。我希望登录部分位于右侧,段落位于中间,标题位于顶部和中间。我试图更改 CSS 中的代码,但没有。
现在的情况:
我想成为什么样的人:
我当前的网站代码:
function resetForm() {
// clearing selects
var selects = document.getElementsByTagName('select');
for (var i = 0; i < selects.length; i++)
selects[i].selectedIndex = 0;
return false;
}
window.load(resetForm());
body {
background-color: #ffffff;
margin: 0;
padding: 200px;
}
h3 {
text-align: center;
color: #ff9900;
padding-bottom: 50px;
}
div.container#login {
float: right;
clear: both;
padding: 20px 20px 20px;
width: 310px;
margin: 0 auto;
border-radius: 3px;
}
div.container #div.content_right #div.login #inputfield {
font-size: 20px !important;
border-radius: 2px;
float: right;
}
div.login#input[type="password"] {
font-size: 20px !important;
border-radius: 2px;
}
input[type="submit"] {
font-size: 18px !important;
font-family: Arial, sans-serif;
color: #ffffff;
background-color: #ff9900;
border: solid;
border-radius: 25px;
}
div.login#input[type="reset"] {
font-size: 18px !important;
font-family: Arial, sans-serif;
color: #ffffff;
background-color: #ff9900;
border: solid;
border-radius: 25px;
}
#footer {
clear: both;
margin-top: 20px;
border-top: 1px solid black;
padding: 20px 0px;
padding-bottom: 20px;
font-size: 70%;
background-color: black;
color: #ff9933;
text-align: center;
text-decoration: none;
bottom: 40px;
}
<div id="container">
<div id="header"></div>statistics</div>
<!--End of Header-->
<!--Pragraph in the center-->
<div id="p">
<p>
Some text
</p>
</div>
<!--End of Pragraph-->
<div id="content">
<div id="content_right">
<div id="login">
<h3>Login</h3>
<form action="login.php" method="POST">
<label>Username:</label>
<br/>
<input class="inputfield" type="text" name="username" size="30" />
<br />
<br/>
<label>Password:</label>
<br/>
<input class="inputfield" type="password" name="password" size="30" />
<br />
<br/>
<input type="submit" value="Login" name="submit" />
<input type="reset" name="reset" value="Clear" />
</form>
<!--End of Login-->
</div>
<!--End of content right-->
</div>
<!--End of content-->
</div>
</div>
<!--End of Container-->
<div id="footer">
footer
</div>
<!--End of Footer-->
【问题讨论】:
-
你没有关闭你的
<div id="header">。