2016-06-10 53 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

你好,你可以编辑这个答案,以更好的格式(使用代码标签)的代码。 –