我目前遇到了 http://jsfiddle.net/XB2r7/6/ 的问题,或者:
.content {
margin-right: auto;
margin-left: auto;
background-color:rgba(64,64,64,0.9);
width: 1000px;
height: auto;
padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 10px;
border: 1px solid #333;
color: #fff;
overflow: auto;
margin-bottom: 20px;
box-shadow: 0px 1px 1px #333;
}
.clear {
clear: both;
}
.sidebar {
width: 23.5%;
height: auto;
display: block;
float: left;
color: #000;
padding-left: 5px;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
margin-bottom: 10px;
background-color: rgba(255,255,255,0.9);
}
.content2 {
width: 73.5%;
height: auto;
display: block;
float: right;
color: #000;
padding-left: 5px;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
margin-bottom: 10px;
background-color: rgba(255,255,255,0.9);
}
.h1 {
font-weight: bold;
}
.content hr {
border: 0;
height: 2px;
background: url('bg3.jpg');
}
正如您在 JSFiddle 上看到的那样,当我放置第二个 content2-div 时,边栏正在下降。有没有办法解决这个问题而无需将它们都放在其他容器中?
最佳答案
关于html - Div 没有停留在正确的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23886567/