1

为什么<div id = "container">高度是 433px?我制作了这个页面http://www.elektroninescigaretes.ym.lt/当我检查一个元素时它显示我 div 只有 433px 我想在页脚上制作版权所有(c)的东西,所以我需要 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;
}
4

2 回答 2

0

把它放在你的风格中:

html body{height: 100%;}
于 2013-01-08T15:29:48.353 回答
0

您设置了 100% 的高度,这意味着如果您的内容增长大于视口(或父容器)表示的 100%,它将不会增长。尝试使用

min-height:100%
于 2013-01-08T15:35:25.993 回答