【发布时间】:2016-06-21 14:21:30
【问题描述】:
我的页面包含三个主要部分:
- 项目箭头框
- 白-绿
- 浅灰色
project-arrow-box 和 light-gray 位于页面左侧,white-green 位于右侧。我希望light-gray 和white-green 的底部在同一点相遇并触摸我的页脚。我的white-green 的部分将根据验证错误或任何情况改变大小。在不同的屏幕尺寸上,这两个 div(light-gray 和 white-green)非常合适。有时light-gray 会超过white-green,反之亦然。同样,无论屏幕大小如何,我都希望这两个 div 的末尾/底部触摸我的页脚。
我尝试将bottom: 0; 添加到light-gray 和white-green,但这没有帮助。我将white-green 的高度设置为自动,因此它适应了这个 div 的扩展性质。这发生在页脚之前,因此页脚与这些问题无关。
我该怎么做才能让这成为可能?
.project_arrow_box {
position: relative;
/*background: rgb(69,186,149);*/
background: #00a16d;
border: 4px solid #00a16d;
width: 33%;
height: 800px;
z-index: 99;
}
#project-content-wrap {
margin: 30% 13%;
}
.white-green {
background-color: rgb(241, 250, 247);
width: 66.56%;
height: auto;
z-index: 55;
margin-left: 33.4%;
margin-right: 0;
position: absolute;
top: 0;
right: 0;
text-align: center;
}
#white-green-section {
position: relative;
left: 30%;
text-align: center;
opacity: 0;
}
.light-gray {
background-color: #E0E0E0;
width: 33.5%;
padding-top: 150px;
bottom: 0;
margin-bottom: 0;
}
.light-gray-container {
left: 15%;
position: relative;
width: 80%;
height: auto;
padding-bottom: 40px;
}
<div class="project_arrow_box">
<div id="project-content-wrap">
</div>
</div>
<div class="white-green">
<div id="white-green-section">
</div>
</div>
<div class="light-gray">
<div class="light-gray-container">
</div>
</div>
【问题讨论】: