简体   繁体   English

页脚在屏幕中间

[英]Footer is in the middle of the screen

I'm trying to make a layout where the footer is always at the end. 我正在尝试进行布局,使页脚始终位于末尾。 However, the HTML body should have a div fixed to the left and right split another with the remaining size. 但是,HTML主体应将div固定在左侧和右侧,并以剩余的大小分割另一个。

Until then I have no problem ... But when the right div has many lines of HTML not generally continues until the end, and the footer is in the middle of the screen. 在那之前,我没有问题……但是,当右div有很多行HTML时,通常直到结尾都不会继续,并且页脚位于屏幕中间。

When # main is with position: relative; 当#main处于位置时:相对; happens the error, but if you take it, the speakers do not work the way I need. 发生错误,但是如果您接听了,扬声器将无法按照我需要的方式工作。

I've tried everything and could not fix. 我已经尝试了所有方法,但无法修复。

Example here: http://jsfiddle.net/WzE3g/ 此处的示例: http : //jsfiddle.net/WzE3g/

#principal 
{
    width:100%; 
    float : left;   
    word-wrap: break-word;    
    /*display: block;*/
    position:relative;
    /*position:inherit;*/
    bottom:0;
}

Use position:fixed; 使用位置:固定; instead of absolute in #rodape element. 而不是#rodape元素中的绝对值。 This way it will be always at the the end. 这样,它将始终处于最后。

我想您是在谈论粘性页脚...这是一个带有说明的示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM