我有一個包裝內部標題,左列和主要內容。 外包裝我得到了頁腳。Div與文本不垂直拉伸內部包裝
我的問題是,主要內容,如果沒有足夠的文本,不會延伸到頁面的底部。如果我插入lorem ipsum等,很多行都沒問題,但如果我嘗試只有幾行,主要的div停止在包裝的最後(或更好的,頁面的結尾,在頁腳之前)。
這裏是我的html代碼
<?php session_start();
unset($_SESSION['message']);
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../css/stili.css" type="text/css" />
<script type="text/javascript" src="../script/scripts.js"></script>
<meta charset="utf-8"/>
<title></title>
<style>
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<?php
include('../php/header.php');
?>
</div>
<div id="leftcolumn">
<?php
include('../php/leftcolumn.php');
?>
</div>
<div id="main" >Welcome to our site
...Some text, but not enough to stretch to the end of page...
</div>
<div style="clear: both"></div>
</div>
<div id="footer">Copyright 2013</div>
</body>
</html>
而這裏的CSS
html,
body {
padding:0;
margin:0;
height:100%;
}
#wrapper {
min-height:100%;
height:auto;
margin:0 auto -30px;
width:950px;
background-color:#E3AA56;
}
#main {
float:right;
width:680px;
padding:10px;
background:#E0CD90;
text-align:justify;
overflow: auto;
}
#main a{
font-size:40px;
}
#footer{
border-top: 2px solid #CCCCCC;
width:950px;
margin:auto ;
height:30px;
background:#ee5;
clear: both;
}
的意見感謝大家,這將有助於發現問題!
爲什麼給我們這麼多的CSS,如果只有一小部分很重要? ;)這讓人們很難幫助你。考慮縮小你的代碼樣本。 – 2013-05-13 22:02:39
對不起,你是對的。我編輯了CSS並留下了最重要的部分,主要,包裝,主體和頁腳 – Sanci 2013-05-13 22:18:26