Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.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
Css 我的“页脚”不会出现在页脚处,如果页面?_Css_Footer - Fatal编程技术网

Css 我的“页脚”不会出现在页脚处,如果页面?

Css 我的“页脚”不会出现在页脚处,如果页面?,css,footer,Css,Footer,嗨,我正在做一个基本的布局,我有一个与我的css问题。 我设置了一个页脚标记,但它没有显示在底部,而是显示在页面的中间点 这是我的CSS代码 我的页脚不会出现在页脚处,如果页面 我想这可能是我设定的高度和宽度,但我不确定该设定什么 提前谢谢 body { background: url("http://ulyssesonline.com/wp-content/uploads/2011/12/darkwood.jpg"); height: 100%; width: 100%; } #socia

嗨,我正在做一个基本的布局,我有一个与我的css问题。 我设置了一个页脚标记,但它没有显示在底部,而是显示在页面的中间点

这是我的CSS代码

我的页脚不会出现在页脚处,如果页面

我想这可能是我设定的高度和宽度,但我不确定该设定什么

提前谢谢

body
{
background: url("http://ulyssesonline.com/wp-content/uploads/2011/12/darkwood.jpg");
height: 100%;
width: 100%;
}


#social {
float: right;
background-color:black;
}

#social1 {
float:right;
background-color:black;
}

#wrapper,#header,#main,#footer
{
width:100%;
}
#wrapper
{
width:960px;
height:720px;
margin:0 auto;
}

#header
{

height:100px;
background:#000;
}

#main
{

height:750px;
background:#666;
}


#footer
{
margin-bottom:-50px; 
height:50px; 
background-color:red;}
} 

我想我明白你的问题了。在页脚css代码中,您有以下内容:

#footer
{
margin-bottom:-50px; 
height:50px; 
background-color:red;}
} 

相当肯定的是,利润底部是一个负数是问题所在。将其更改为5或10,然后查看是否显示。

将页脚替换为:

#footer
{  position:absolute;
   bottom:0;
   width:100%;
   height:50px;   /* Height of the footer */
   background:#6cf;
background-color:red;}
本教程使用了:

这是我的完整CSS:

body
{
background: url("http://ulyssesonline.com/wp-content/uploads/2011/12/darkwood.jpg");
height: 100%;
width: 100%;
}


#social {
float: right;
background-color:black;
}

#social1 {
float:right;
background-color:black;
}

#wrapper,#header,#main,#footer
{
width:100%;
}
#wrapper
{
width:960px;
height:720px;
margin:0 auto;
}

#header
{

height:100px;
background:#000;
}

#main
{

height:750px;
background:#666;
}
这就是我从html中引用它的方式:

<footer  id ="footer">Some footer text</footer>

我怀疑您没有正确地引用它,使用了您部门的正确id?

我收到了它,谢谢您的帮助

我从上面的答案中得到这个

#footer
{  position:absolute;
bottom:0;
width:100%;
height:50px;   /* Height of the footer */
background:#6cf;
background-color:red;}
我不得不把主要部分改成

#main
{
position:relative;
height:100%;
background:#666;
}

你的边际底线是:-50px,你注意到了吗???我认为你正面临着这个问题,因为这是为了得到一个清晰的概念,可能的重复并没有什么区别这似乎应该奏效。。。查看本教程,看看这是否有帮助。你有两个括号,两英尺。你让我发笑@FrantišekMašaThe页脚仍在页面的一半位置,我必须将主要部分声明为相对位置