Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html div容器不';不要根据里面的内容来判断高度_Html_Containers - Fatal编程技术网

html div容器不';不要根据里面的内容来判断高度

html div容器不';不要根据里面的内容来判断高度,html,containers,Html,Containers,为什么的高度是433px?我制作了这个页面,当我插入一个元素时,它显示我的div只有433px,我想在页脚上制作所有版权保留(c)的东西,所以我需要div有所有页面的高度,而不仅仅是上半部分 //index file <?php include ("template/header.php"); ?> <div id = "home_content"></div> <?php include ("template/footer.php"); ?>

为什么
的高度是433px?我制作了这个页面,当我插入一个元素时,它显示我的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;
}
//索引文件
//头文件
艾尔雪茄

把它放在你的风格中:

html body{height: 100%;}

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

min-height:100%

请:格式化您的代码,格式化您的文本,并问一个明确的问题
#主页内容
不在文档流中,因为它具有属性
位置:绝对
。如果删除该属性,则允许内容展开父容器。很遗憾,您必须更改网站的工作方式,但您可能只能设置一个固定高度。谢谢,我添加了最小高度:100%,但它没有显示我列表中的所有项目,所以我在底部添加了填充,现在很好:)