CSS 页脚覆盖页面底部

CSS footer covering up bottom of page

我有一个页脚,我想保留在页面底部,所以您必须向下滚动到页面底部才能看到它,由于某种原因它覆盖了页面的一部分,我可以肯定这是页脚的问题,当我将其注释掉时问题就消失了,这是页脚的 CSS:

   /*Footer*/
.footer-distributed{
    background-color: #292c2f;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    width: 100%;
    text-align: left;
    font: bold 16px sans-serif;

    padding: 55px 50px;
  margin-top: 80px;
  position: absolute;
  display: inline-block;
  bottom:0;
  width: 100%;
  flex: 0 0 50px;/*or just height:50px;*/
  margin-top: auto;
}

.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
    display: inline-block;
    vertical-align: top;
}

/* Footer left */

.footer-distributed .footer-left{
    width: 40%;
}

/* The company logo */

.footer-distributed h3{
    color:  #ffffff;
    font: normal 36px 'Cookie', cursive;
    margin: 0;
}

.footer-distributed h3 span{
    color:  #5383d3;
}

/* Footer links */

.footer-distributed .footer-links{
    color:  #ffffff;
    margin: 20px 0 12px;
    padding: 0;
}

.footer-distributed .footer-links a{
    display:inline-block;
    line-height: 1.8;
    text-decoration: none;
    color:  inherit;
}

.footer-distributed .footer-company-name{
    color:  #8f9296;
    font-size: 14px;
    font-weight: normal;
    margin: 0;
}

/* Footer Center */

.footer-distributed .footer-center{
    width: 35%;
}

.footer-distributed .footer-center i{
    background-color:  #33383b;
    color: #ffffff;
    font-size: 25px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    text-align: center;
    line-height: 42px;
    margin: 10px 15px;
    vertical-align: middle;
}

.footer-distributed .footer-center i.fa-envelope{
    font-size: 17px;
    line-height: 38px;
}

.footer-distributed .footer-center p{
    display: inline-block;
    color: #ffffff;
    vertical-align: middle;
    margin:0;
}

.footer-distributed .footer-center p span{
    display:block;
    font-weight: normal;
    font-size:14px;
    line-height:2;
}

.footer-distributed .footer-center p a{
    color:  #5383d3;
    text-decoration: none;;
}


/* Footer Right */

.footer-distributed .footer-right{
    width: 20%;
}

.footer-distributed .footer-company-about{
    line-height: 20px;
    color:  #92999f;
    font-size: 13px;
    font-weight: normal;
    margin: 0;
}

.footer-distributed .footer-company-about span{
    display: block;
    color:  #ffffff;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-distributed .footer-icons{
    margin-top: 25px;
}

.footer-distributed .footer-icons a{
    display: inline-block;
    width: 35px;
    height: 35px;
    cursor: pointer;
    background-color:  #33383b;
    border-radius: 2px;

    font-size: 20px;
    color: #ffffff;
    text-align: center;
    line-height: 35px;

    margin-right: 3px;
    margin-bottom: 5px;
}

/* If you don't want the footer to be responsive, remove these media queries */

@media (max-width: 880px) {

    .footer-distributed{
        font: bold 14px sans-serif;
    }

    .footer-distributed .footer-left,
    .footer-distributed .footer-center,
    .footer-distributed .footer-right{
        display: block;
        width: 100%;
        margin-bottom: 40px;
        text-align: center;
    }

    .footer-distributed .footer-center i{
        margin-left: 0;
    }

}

如果问题出在其他问题上,这里是其他问题 CSS:

  html {
    line-height: 1.15; /* 1 */
    -webkit-text-size-adjust: 100%; /* 2 */
}

/* Sections
     ========================================================================== */

/**
 * Remove the margin in all browsers.
 */

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

最后:

.container-history{
padding-left: 10%;
padding-right: 10%;
overflow: visible;

}

如有任何帮助,我们将不胜感激。

编辑: 这里有一个CodePen.ioLinkhttps://codepen.io/Pagaley12/pen/JBLmrJ

当您将元素设置为绝对定位时,它与页面流分离。这意味着它不会占用页面上的任何高度。所以页面在主要内容结束时结束。

要解决您的问题,请在主要内容末尾添加边距。在你的情况下是 .content-area.

.content-area {
  margin-bottom:230px
}

找到适合您情况的正确保证金值。

示例:CodePen

将属性position: relative;添加到classfooter-distributed,这将解决问题

这是一个简单的修复。

/*Footer*/

.footer-distributed{

background-color: #292c2f;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
width: 100%;
text-align: left;
font: bold 16px sans-serif;

padding: 55px 50px;
  margin-top: 80px;
  position: relative;
  display: inline-block;
  bottom:0;
  width: 100%;
  flex: 0 0 50px;/*or just height:50px;*/
  margin-top: auto;

}

页脚的位置应该相对。它会在主要内容结束后出现或显示。绝对保留并屏蔽内容。

你可以给它一个高度,这样它在移动视图中就不会表现得很奇怪。 https://www.w3schools.com/cssref/css_units.asp