【发布时间】:2014-01-15 11:15:51
【问题描述】:
我遇到了问题,我找不到合适的解决方案,我有两个 div,当我将大小调整到 800 像素以下(1ºdiv 宽度 + 2ºdiv 宽度)时,第二个移到 1º 的下方.我想要的是修复元素(不是“固定”位置),但无论如何我都希望它们并排放置,比如在 Facebook 页面或谷歌中,当我调整大小时,即使它们去“外面”,它们也会留在同一个地方窗户。 http://jsfiddle.net/VLt9m/。提前致谢。
#wrapper {
padding:92px 0 0 0;
width:100%;
float:left;
}
#content a {
text-decoration: none;
}
#block1{
background-color: #FFC374;
width:400px;
height:400px;
margin:0;
float: left;
position: relative;
}
#b1Title{
width:400px;
height:100px;
margin:0;
background-color: #FFD190;
opacity: 0.8;
position: absolute;
}
#b1Title h1{
color: #222;
font-size: 200%;
margin: 8% 0 0 12%;
}
#block2{
background-color:#449DCC;
width:400px;
height:400px;
margin:0;
float: left;
position: relative;
}
#b2Title{
width:400px;
height:100px;
margin:0;
background-color:#80B7D7;
opacity: 0.8;
position: absolute;
}
#b2Title h1{
color: #222;
font-size: 200%;
margin: 8% 0 0 12%;
}
【问题讨论】:
-
你能做一个jsfiddle.net 演示吗?
-
ofc,完成。 jsfiddle.net/VLt9m