div 之后的内容具有绝对位置和自动高度
Content after div with absolute position and auto height
下午好!
我正在尝试完成这项工作 - 我有一个 <div>
,带有 position: absolute
和 height: 100%; min-height: 100%;
,所以高度是自动的。我想在这个之后放置另一个 <div>
,但我不知道,我应该在 margin-top 处使用多少 %,或者哪种位置......
这是我的代码,我会很高兴得到每一个建议!谢谢!
HTML:
<div id="content">
...text text text...
</div>
<div class="clr"></div>
<div id="copyright">
text text...
</div>
CSS:
#content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-height: 100%;
background: url('bg_blue.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.clr {
clear: both;
}
#copyright {
position: static;
margin: 0 auto;
width: 100%;
height: 200px;
background-color: black;
}
我已经用 position: relative;
和 float: left;
解决了
是 position: relative;
和 float: left;
可以轻松实现
下午好!
我正在尝试完成这项工作 - 我有一个 <div>
,带有 position: absolute
和 height: 100%; min-height: 100%;
,所以高度是自动的。我想在这个之后放置另一个 <div>
,但我不知道,我应该在 margin-top 处使用多少 %,或者哪种位置......
这是我的代码,我会很高兴得到每一个建议!谢谢!
HTML:
<div id="content">
...text text text...
</div>
<div class="clr"></div>
<div id="copyright">
text text...
</div>
CSS:
#content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-height: 100%;
background: url('bg_blue.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.clr {
clear: both;
}
#copyright {
position: static;
margin: 0 auto;
width: 100%;
height: 200px;
background-color: black;
}
我已经用 position: relative;
和 float: left;
是 position: relative;
和 float: left;