2015-04-06 33 views
0

我有emberjs應用程序,我試圖創建粘性頁腳。燼js中的粘性頁腳

我的HTML:

<div class="main-container" id=""> 
    <header> HEADER </header> 

    <div class="container"> 
    {{outlet}} 
    </div> 

    <footer> 
    footer text 
    </footer> 
</div> 

的CSS:

.ember-view { 
    height: 100%; 
} 

.main-container { 
    min-height: 100%; 
    height: auto !important; 
    height: 100%; 
    margin: 0 auto -40px; 
} 

footer { 
    clear: both; 
    line-height: 40px; 
    width: 100%; 
} 

對於未知原因頁腳仍然沒有堅持到了谷底。

任何想法?

感謝很多:)

+0

'的位置是:固定; && bottom:0;'在頁腳選擇器上。你嘗試過嗎? – dowomenfart 2015-04-06 13:03:00

+0

這是一個[Plunker](http://plnkr.co/edit/jE2Wpsev1dK8oOYimyyU?p=info)向你展示我需要使用它的CSS。 – 2016-08-28 20:22:53

回答

0

在你的CSS,你應該添加以下屬性到您的頁腳

footer { 
position: fixed; 
bottom: 0; 
} 
+0

我不想要固定頁腳。我想將頁腳粘貼到頁面底部 – noamkn 2015-04-06 15:30:56