CSS で TV モニター プロジェクトのフルスクリーン レイアウトを作成しようとしていますが、画面サイズに関係なく、レイアウトが動的に画面全体に表示されます。
私の目標は、次のようなページを取得することです。
----------------------------
| header |
----------------------------
| l| |r |
| e| |i |
| f| |g |
| t| content |h |
| | |t |
| | | |
| | | |
----------------------------
| footer |
----------------------------
これまでのところ、ヘッダーとフッターを含む CSS のパーセンテージを使用して、ほとんどの動的サイズ変更を行うことができました。ただし、左、コンテンツ、および右のセクションで画面の中央領域を完全に埋めることはできません。
以下のコードから、中央のセクションが常に赤い div の 100% をカバーする必要があるため、赤い div は表示されません。max-height/width を 100% に設定して継承しようとしましたが、うまくいきません。
このレイアウトを機能させるために数時間 (prlly 10+) を費やしましたが、どこにも行きません。この時点で、CSS を変更し、コードを移動して、たまたま機能するかどうかを確認しています。
これらのセクションを正しく入力できないのはなぜですか? 誰かが私を正しい方向に向けることができますか? 以下のコード。
index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<title></title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<header class="header">
<strong>Header:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tortor. Praesent dictum, libero ut tempus dictum, neque eros elementum mauris, quis mollis arcu velit ac diam. Etiam neque. Quisque nec turpis. Aliquam arcu nulla, dictum et, lacinia a, mollis in, ante. Sed eu felis in elit tempor venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut ultricies porttitor purus. Proin non tellus at ligula fringilla tristique. Fusce vehicula quam. Curabitur vel tortor vitae pede imperdiet ultrices. Sed tortor.
</header><!-- .header-->
<aside class="left-sidebar">
<strong>Left Sidebar:</strong> Integer velit. Vestibulum nisi nunc, accumsan ut, vehicula sit amet, porta a, mi. Nam nisl tellus, placerat eget, posuere eget, egestas eget, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In elementum urna a eros. Integer iaculis. Maecenas vel elit.
</aside><!-- .left-sidebar -->
<aside class="right-sidebar">
<strong>Right Sidebar:</strong> Integer velit. Vestibulum nisi nunc, accumsan ut, vehicula sit amet, porta a, mi. Nam nisl tellus, placerat eget, posuere eget, egestas eget, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In elementum urna a eros. Integer iaculis. Maecenas vel elit.
</aside><!-- .right-sidebar -->
<div class="container">
<main class="content">
<strong>Content:</strong> Sed placerat accumsan ligula. Aliquam felis magna, congue quis, tempus eu, aliquam vitae, ante. Cras neque justo, ultrices at, rhoncus a, facilisis eget, nisl. Quisque vitae pede. Nam et augue. Sed a elit. Ut vel massa. Suspendisse nibh pede, ultrices vitae, ultrices nec, mollis non, nibh. In sit amet pede quis leo vulputate hendrerit. Cras laoreet leo et justo auctor condimentum. Integer id enim. Suspendisse egestas, dui ac egestas mollis, libero orci hendrerit lacus, et malesuada lorem neque ac libero. Morbi tempor pulvinar pede. Donec vel elit. Sed placerat accumsan ligula. Aliquam felis magna, congue quis, tempus eu, aliquam vitae, ante. Cras neque justo, ultrices at, rhoncus a, facilisis eget, nisl.
</main><!-- .content -->
</div><!-- .container-->
</div><!-- .wrapper -->
<footer class="footer">
<strong>Footer:</strong> Mus elit Morbi mus enim lacus at quis Nam eget morbi. Et semper urna urna non at cursus dolor vestibulum neque enim. Tellus interdum at laoreet laoreet lacinia lacinia sed Quisque justo quis. Hendrerit scelerisque lorem elit orci tempor tincidunt enim Phasellus dignissim tincidunt. Nunc vel et Sed nisl Vestibulum odio montes Aliquam volutpat pellentesque. Ut pede sagittis et quis nunc gravida porttitor ligula.
</footer><!-- .footer -->
</body>
</html>
スタイル.css:
/* Eric Meyer's CSS Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* End of Eric Meyer's CSS Reset */
html {
height: 100%;
width: 100%;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
display: block;
}
body {
font: 12px/18px Arial, sans-serif;
height: 100%;
}
.wrapper {
min-width: 100%;
margin: 0 auto;
min-height: 80%;
background-color: red;
}
/* Header
-----------------------------------------------------------------------------*/
.header {
height: 20%;
background: #FFE680;
padding: 10px 10px 10px 10px;
}
/* Middle
-----------------------------------------------------------------------------*/
.middle {
width: 100%;
height: auto;
position: relative;
}
.middle:after {
display: table;
clear: both;
content: '';
}
.container {
width: auto;
height: auto;
float: inherit;
overflow: hidden;
margin-left: auto;
margin-right: auto;
background-color: grey;
}
.content {
padding: 10px 10px 10px 10px;
min-width: 100%;
height: auto;
min-height: 100%;
}
/* Left Sidebar
-----------------------------------------------------------------------------*/
.left-sidebar {
float: left;
width: 25%;
min-height: 100%;
max-height: 100%;
position: relative;
background: #B5E3FF;
padding: 10px 10px 10px 10px;
overflow: hidden;
}
/* Right Sidebar
-----------------------------------------------------------------------------*/
.right-sidebar {
float: right;
min-width: 25%;
max-width: 25%;
width: 25%;
background: #FFACAA;
height: 100%;
padding: 10px 10px 10px 10px;
overflow: hidden;
}
/* Footer
-----------------------------------------------------------------------------*/
.footer {
width: 100%;
height: 20%;
background: #BFF08E;
}