2016-04-11 42 views
3

由于我的页脚HTML标记切换位置,我无法定位它。 正如您在我的IDE中看到的,我已将页脚设置为位于HTML部分的最底部。但是,一旦我运行我的应用程序,它会改变位置2线。定位页脚

是因为重新弹出框配置?任何想法如何解决这个问题? 这是图像,使其更容易理解。

enter image description here

这里是我的CSS-页脚代码:

.footer { 
    position: absolute; 
    right: 0; 
    bottom: 0; 
    left: 0; 
    padding: 1rem; 
    text-align: center; 
    background: #2E3438; 
    color:white; 
    height: 23px; 
    line-height: 8px; 
    font-size: 13px;   
} 

和HTML和身体,我不能改变由于remodal流行的错误:Twitter Bootstrap modal pushes html content to the left

html { 
    overflow: hidden; 
    height: 100%; 
} 
body { 
    overflow: auto; 
    height: 100%; 
} 

编辑(给出的答案后): 这是你需要改变的代码(a PPEND预先考虑)的文件名是jquery.remodal.js

if (!remodal.$overlay.length) { 
     remodal.$overlay = $('<div>').addClass(namespace + '-overlay'); 
     remodal.$body.prepend(remodal.$overlay); 
    } 

    remodal.$bg = $('.' + namespace + '-bg'); 
    remodal.$closeButton = $('<a href="#"></a>').addClass(namespace + '-close'); 
    remodal.$wrapper = $('<div>').addClass(namespace + '-wrapper'); 
    remodal.$modal = $modal; 
    remodal.$modal.addClass(namespace); 
    remodal.$modal.css('visibility', 'visible'); 

    remodal.$modal.prepend(remodal.$closeButton); 
    remodal.$wrapper.prepend(remodal.$modal); 
    remodal.$body.prepend(remodal.$wrapper); 
+3

如果生成**。remodal-overlay **和**。remodal-wrapper **。它们将始终显示在底部,除非您尝试在**。页脚**之上创建** div **并设置**重新覆盖**和**重新包装**仅在**内部生成** div **您制作的 – Abbr

+0

自HTML5以来,我们使用'footer'标签。我邀请你看看它。 – Seblor

+0

@html 5页脚或没有,它再次保持不变 –

回答

4

remodal js脚本只是附加在文件准备这些div -s。

正如我在重做主页中所看到的,它们都是position: fixed,只要您没有更改这些重装容器的造型 - 它们无法改变绝对位置的页脚。

其他地方可能存在问题。您可以修改重新编写的脚本并预先(或放置在其他地方)这些容器,但我认为这不重要。

也许有一个remodal风格的问题?您可以从DOM中删除样式进行测试(仅留下js)。

+0

我已经改变了脚本预先而不是附加,没有任何帮助.. –

+0

你试过没有重组的CSS? –

+0

呵呵,我不相信现在所有相关的附加功能都已经变成了! Tnx男人,当之无愧+100。 .prepends works perfeclty。我必须等23小时才能奖励你... –