这是我的html代码,当我设置#login id浮动它只是重叠#关于博客ID。浮动属性不工作在我的css
#login{
background-color: #00FFFF;
float: right;
width: 70%;
height: 40%;
position: absolute;
z-index: 2;
}
#about-blog{
background-color: #A4DDED;
width: 30%;
height: 50%;
position: absolute;
z-index: 1;
}
以下是完整的代码{下面的代码,我已经提供了更多的信息}
<<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
\t <title>Kvians-Home</title>
\t <style type="text/css">
body {
\t background-color: #F0FFF0;
\t color: rgb(255,255,255);
\t font-family: monospace;
\t font-style: italic;
\t font-weight: bold;
\t font-size: 20px;
}
.main-heading {
\t background-color: #0048ba;
\t text-align: center;
\t font-size: 35px;
\t font-weight: bold;
\t margin: 0px;
}
#login{
\t background-color: #00FFFF;
\t float: right;
\t width: 70%;
\t height: 40%;
\t position: absolute;
\t z-index: 2;
}
#about-blog{
\t background-color: #A4DDED;
\t width: 30%;
\t height: 50%;
\t position: absolute;
\t z-index: 1;
}
/* all about links */
a{
\t background-color: #00FF00;
\t color: #00693E;
\t font-weight: Bold;
\t font-size: 25px;
}
a:visited{
background-color: #DFFF00;
color: #FF7F00;
}
a:hover{
\t background-color: #91A3B0;
\t color: rgb(0,0,0);
}
.left-margin{
\t margin-left: 5px;
}
/* all about links*/
</style>
</head>
<body>
<!--facebook SDK-->
<!-- Facebook SDK end-->
<!--page begin-->
<h1 class="main-heading">Here You Will Get</h1>
<!--Main Body Design-->
<div id="about-blog">
<h2 class="left-margin">School Feeds</h2>
<p class="about-blog-para-one left-margin"> Visit our awesome blog,<br> here you will get updates about school</p>
<a class="left-margin school-feeds"href="http://kvians.weebly.com/school-feeds" target="_blank">Visit</a>
</div>
<div id="login">
<h2>Login</h2>
<p>Login to <strong>Kvians</strong> from your facebook account, just click the login button here</p>
</div>
</body>
</html>
我怎么可以设置登录到正确和公正的重叠大约博客几个像素。
对于未来的用户来说,请接受最好解决您的问题的答案(如果有的话) – LGSon