【发布时间】:2014-01-04 06:08:49
【问题描述】:
我的代码有小问题。 少量文本看起来非常好(firefox / chromium - 窗口最大化):
CSS:
* { margin: 0; padding: 0; }
html, body { height: 100%; max-height: 100%; overflow: hidden; width: 100%; }
body > div:last-child > div { width: 100%; }
body{
display: flex;
flex-direction: column;
}
body > div:first-child{
display: flex;
flex-grow: 0;
height: auto;
}
body > div:first-child > div{flex-grow: 1;}
body > div:last-child{
align-items: center;
background-color: black;
color: white;
display: flex;
flex-grow: 1;
overflow: auto;
}
HTML:
<body>
<div>
<div style="background-color: red;">Left</div>
<div style="background-color: green; text-align: center;">Center</div>
<div style="background-color: blue; text-align: right;">Right</div>
</div>
<div>
<div style="text-align: center;">
Start<br>
Test<br>Test<br>Test<br>Test<br>Test<br>
Test<br>Test<br>Test<br>Test<br>Test<br>
Test<br>Test<br>Test<br>Test<br>Test<br>
Test<br>Test<br>Test<br>Test<br>Test<br>
Test<br>Test<br>Test<br>Test<br>Test<br>
End
</div>
</div>
</body>
但是当我添加:“Test(...)”x2 - 我的高度有问题,默认设置为自动。
这是 JSFIDDLE。
这是一个带有 x2 文本的 JSFIDDLE - 这是我的问题。
感谢您的帮助。
【问题讨论】: