Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在底部放置页脚_Html_Css - Fatal编程技术网

Html 在底部放置页脚

Html 在底部放置页脚,html,css,Html,Css,我试着把我的页脚放在页面底部,而不是粘在一起。我将底部设置为0px,但当页面太长时,我的页脚会停留在顶部而不是页面底部。此外,我的页脚一直粘着我的徽标,而不是在页面底部。我应该如何解决此问题 这里有一个例子 CSS HTML 在社交媒体上关注我们! 谢谢你的帮助 将position relative属性添加到html标记,并将position absolute添加到页脚,如下所示,页脚将始终位于页面内容的底部 html{ 最小高度:100%; 位置:相对位置; } .标志{ 显示:块; z

我试着把我的页脚放在页面底部,而不是粘在一起。我将底部设置为0px,但当页面太长时,我的页脚会停留在顶部而不是页面底部。此外,我的页脚一直粘着我的徽标,而不是在页面底部。我应该如何解决此问题

这里有一个例子 CSS

HTML


在社交媒体上关注我们!

谢谢你的帮助

将position relative属性添加到html标记,并将position absolute添加到页脚,如下所示,页脚将始终位于页面内容的底部

html{
最小高度:100%;
位置:相对位置;
}
.标志{
显示:块;
z指数:20;
高度:200px;
左边距:自动;
右边距:自动;
边缘顶部:100px;
}
.页脚{
宽度:100%;
背景:rgba(0,0,0,0.6);
位置:绝对位置;
底部:0;

}
添加到页脚位置:修复了可能重复的
.logo {
    display: block;
    z-index: 20;
    height: 200px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 100px;
}

footer {
    width: 100%;
    background: rgba(0,0,0,0.6);
    bottom: 0;  
}
    <footer class="footer">
        <div class="container text-center">
            <h4>Follow Us On Social Media!</h4>
            <a href="#"><i class="fa fa-facebook-square fa-3x" aria-hidden="true"></i></a>
            <a href="#"><i class="fa fa-twitter-square fa-3x"></i></a>
            <a href="#"><i class="fa fa-google-plus-square fa-3x"></i></a>
            <a href="#"><i class="fa fa-instagram fa-3x" aria-hidden="true"></i></a>
        </div><!--End container-->
    </footer><!--End footer 2-->