我有一個問題,這是困擾着我這些天。 我必須做一個佈局: a .header和.content像固定高度(例如100px)和100%寬度。 然後,我必須把內容與動態高度,覆蓋空隙空間。固定頁眉和頁腳與動態內容(照片庫站點)
[...]
<style type="text/css">
body {margin:0;padding:0;}
.wrapper {height:100%;width:100%;position:absolute;}
.header {position:absolute;top:0;height:100px;width:100%;background:#0F0;}
.footer {position:absolute;bottom:0;height:100px;width:100%;background:#0F0;}
.content {position:absolute;height:100%;width:100%;background:#F00;padding:100px 0;margin:-100px 0;}
</style>
</head>
<body>
<div class="wrapper">
<div class="header">
</div>
<div class="content">
</div>
<div class="footer">
</div>
</div>
</body>
</html>
這種佈局民政事務總署允許我把一個標頭和固定高度頁腳,並與該級尺寸(一div.content內)圖像
嗨洛倫佐,你有什麼問題?你能否嘗試多解釋一下。 – hairynuggets
所以你想讓'.content'填充'.header'和'.footer'之間的空格? – jackJoe
你想要一個帶有滾動固定頁眉和頁腳和可滾動內容的HTML頁面嗎? – buschtoens