2016-06-10 46 views
0

我實際上正在研究這個Wordpresswebsite我試圖通過代碼修復頁腳(因爲通過主題選項不可能使用此模板)。WordPresspress:修復頁腳

這是footer.php代碼

<!-- Footer --> 
    <footer> 
    <div class="container-fluid"> 
    <div class="row padding-bottom48"> 
    <div class="col-md-12 text-center padding-top48 text-footer"> 

    <?php sierra_opt_footer_text(); ?> 
    <?php sierra_opt_footer_social_icons(); ?> 

    <div class="text-center padding-top72"> 
    <a href="#" class="scroll-to relative"> 
    <p class="sierra-arrow-up"></p> 
    </a> 
    </div> 
    </div> 
    </div> 
    </div> 
    </footer> 
<!-- end footer --> 

我在簡單的方法嘗試:

footer { position: fixed;) 

沒有好的結果。

我該如何讓頁腳變得粘滯和固定?

感謝您的建議。

回答

1

試試這個代碼

footer { 
    bottom: 0; 
    position: fixed; 
    width: 100%; 
} 

並添加高度按您的要求

0

這應該做的伎倆(改編自CSS-Tricks)。您應該將page-wrap更改爲您的主題「頁面包裝」類,或者如果缺少,請添加一個。

* { 
    margin: 0; 
} 
html, body { 
    height: 100%; 
} 
.page-wrap { 
    min-height: 100%; 
    /* equal to footer height */ 
    margin-bottom: -142px; 
} 
.page-wrap:after { 
    content: ""; 
    display: block; 
} 
footer, .page-wrap:after { 
    height: 142px; 
} 
0

試試這個

footer { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
} 
0

你的CSS應該是這樣的:

.container-fluid { 
 
    position: fixed; 
 
    bottom: 0px; 
 
}

我不知道爲什麼你要修復您的頁腳,不過,頁腳非常大,從其餘的頁面佔用大量的屏幕空間e網站;頁腳並不重要。這種情況下你的意圖是什麼?

0

刪除頁腳高度並添加以下css: 頁腳{ position:fixed; bottom:0; 寬度:100%; }

+0

你好,你可以編輯這個答案,以更好的格式(使用代碼標籤)的代碼。 –