【发布时间】:2015-11-03 01:22:38
【问题描述】:
基本上我正在寻找这个:
Two Divs next to each other, that then stack with responsive change
但是,困难在于我需要将 Div #2(右 div)堆叠在 Div #1(左 div)之上,而不是被推到它下面。
我必须将 div 并排放置如下:
<div class="container" style="width: 1100px">
<div class="left-div" style="float: left; width: 700px;"> </div>
<div style="float: left; width: 300px;"> </div>
</div>
我尝试的是做一个 css 媒体查询,它只是将左 div 向下推 300px,使用以下内容:
@media screen and (max-width: 1100px) {
.left-div {
position: relative;
top: 350px;
}
}
但是,这不会导致右侧 div 向左对齐并堆叠在顶部。有什么想法吗?
【问题讨论】: