使div高度按比例自动调整

时间:2015-06-05 21:09:49

标签: html css responsive-design height

在这个页面上...... http://www.gogeye.com/eomnew/eom-success/我有50%宽的div,再次分成40%和60%。左侧部分包含图像,因此当浏览器窗口收缩时将自动调整其高度。我希望包含文字和背景图片的右侧在发生这种情况时也会降低其高度,但不知道有任何实现此方法的方法

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

我解决了它(在某种程度上),在底部添加了大量的填充,然后是相同数量的负边距。

然后我让父div溢出:隐藏

.success (parent) {
position:relative;
overflow:hidden;
}

.testipic {
width:40%;
float:left;
}

.testirest {
margin-bottom: -99999px;
padding-bottom: 99999px;
width:60%;
float:right;
background-image:url('img/lines-light.png');
}
相关问题