2013-01-08 75 views
1

爲什麼高度爲433px?我做這個頁面http://www.elektroninescigaretes.ym.lt/,當我檢測一個元素它顯示我div只有433px,我想在頁腳作出保留所有權利(三)的東西,所以我需要div的所有頁面的高度不僅上部。html div容器內部不受高度影響

//index file 
<?php include ("template/header.php"); ?> 
<div id = "home_content"></div> 
<?php include ("template/footer.php"); ?> 


//header file 

<!DOCTYPE html> 
<html> 
<head> 
<link rel = "stylesheet" href = "media/styles/style.css" media = "screen"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>el Cigarai</title> 
</head> 
<body class = "<?php 
$remove = array(".php", "/"); 
$url = $_SERVER['SCRIPT_NAME']; 
$current_file = str_replace($remove, "", $url); 
$current_page = explode('_', $current_file); 
echo $current_page[0]; 
?>"> 

<div id = "container"> 

//footer file 

</div> 
</body> 
</html> 

    /style file 

#container{ 
position: relative; 
margin: 0 auto; 
width: 960px; 
height: 100%; 
} 
#home_content{ 
position: absolute; 
top: 294px; 
right: 60px; 
width: 960px; 
height: 750px; 
background-image: url('../images/woman.jpg'); 
background-repeat: no-repeat; 
overflow: hidden; 
} 
+1

請:格式代碼,設置文本格式,並要求一個清晰的問題 –

+0

'#home_content'是出了文檔流,因爲它具有屬性'位置:absolute'。如果刪除該屬性,則允許內容展開父容器。不幸的是,你將不得不改變網站的工作方式,但你也許可以設置一個固定的高度。 –

回答

0

你有100%的組的高度,這意味着如果你的內容的增加不是由視口(或父容器)所代表的100%時,它不會增長。嘗試使用

min-height:100% 
+0

謝謝我添加了最小高度:100%,但它沒有顯示我的清單上的所有項目,所以我添加了填充底部,現在是好的:) – Driglou

0

把這個在你的風格:

html body{height: 100%;}