モバイル Web アプリ用の柔軟なレイアウトを作成しようとしていますが、これを CSS テーブルで機能させるのに苦労しています。現在、私は古いフレックスボックスを使用していますが、CSS テーブルでそれを複製しようとしました。常に 100% の高さのコンテンツ コンテナーを使用して、高さを固定したヘッダーを使用したいと考えています。
どこが間違っていますか?また、フレックスボックスはより良い選択肢でしょうか? (流動的ではありますが)
-----------------------------
| .header |
-----------------------------
| |
| |
| |
| .inner-container |
| |
| |
-----------------------------
.
(失敗した)cssテーブルの例 と、動作するフレックスボックスの例を作成しました
.
<div class='wrap'>
<div class='header'></div>
<div class='inner-container'></div>
</div>
.wrap {
display: table;
overflow: hidden;
width: 100%;
height: 100%;
border: 1px solid;
}
.header {
display: table-cell;
background: red;
height: 60px;
width: 100%;
}
.inner-container {
display: table-cell;
background: blue;
width: 100%;
height: 100%;
}