我的侧边栏没有按“当我添加的内容牛逼垂直拉伸 我怎样才能使HTML和CSS只使用侧边栏不垂直拉伸
HTML代码成长:?
<div id="main">
<section>
a lot of text here...
</section>
<div id="sidebar">
a lot of text here...
</div>
</div>
<footer>
Copyright © domain.com 2014
</footer>
CSS代码:
#main{
background: #ffffff;
width: 60%;
margin: auto;
padding: 20px;
position:relative;
}
section{
width: 75%;
margin: 40px 0;
padding: 0;
line-height: 1.5em;
min-height: 100px;
}
#sidebar{
width:150px;
position: absolute;
margin: 60px 0 0 10px;
padding: 0 20px 0 20px;
right:0;
bottom:0;
top:0;
line-height: 1.5em;
}
footer{
width: 60%;
background-color: #700505;
text-align: center;
padding: 20px;
padding-top: 10px;
padding-bottom: 10px;
margin: auto;
margin-bottom: 20px;
color: #ffffff;
}
我知道有可能是在那里有很多不需要的属性...
编辑:现在增加了页脚,我希望这就够了。复制时必须添加很多行以使其与页脚重叠。
你能上传更多的源代码吗? – 2014-10-18 18:16:54
请提供所有必要的代码来重现问题。 – George 2014-10-18 18:17:20
@IPADDRESS添加了更多源代码。 – user3002135 2014-10-18 18:32:15