简体   繁体   English

边距不会应用于页脚

[英]Margin doesn't get applied to a footer

Here is my website so you can see the problem: webpage 这是我的网站,因此您可以看到问题: 网页

The problem is that my .footer Has a margin: 50px 0 50px 0; 问题是我的.footer有一个margin: 50px 0 50px 0; , but for some reason it doesn't appear to have that 50px margin from top. ,但是由于某种原因,它似乎没有顶部50px的空白。 I don't understand what is causing the problem. 我不明白是什么引起了问题。

Here is full css of footer section ( .dashed-footer is basically inner section of the footer with that dashed border.) 这是页脚部分的完整CSS( .dashed-footer基本上是带有虚线边框的页脚的内部部分。)

CSS 的CSS

.footer {
    margin: 50px 0 50px 0;
    background-color: #1d130e;
    width: 100%;
    min-width: 1000px;
    height: 50px;
    border-top: 1px solid #0d0907;
    border-bottom: 1px soid #0d0907;
    clear: both;

    -webkit-box-shadow: 0px 0px 15px -1px #181513;
    box-shadow: 0px 0px 15px -1px #181513;
}

.dashed-footer {
    height: 37px;
    margin-top: 5px;
    text-align: center;
    line-height: 38px;
    border-top: 1px dashed #613e27 !important;
    border-bottom: 1px dashed #613e27 !important;
    color: #e6d7bb;
    text-shadow: 1px 1px 0 #000;
}
overflow: hidden;

to the section.content is the answer. section.content是答案。 It is because the elements inside it are floated which takes them out of the normal flow of the document. 这是因为其中的元素是浮动的,这使它们脱离了文档的正常流程。

I think it is because the margin is applied, 50px down from <section id="content"> , but the trio is for some reason placed outside that section, and pushing the footer down! 我认为这是因为应用了页边距,距<section id="content">向下50px,但是由于某种原因,三重奏被放置在该部分之外,并且将页脚向下推! If you choose 'inspect element' and mouse-over <section id="content"> you can see it stops at the downside of the slides, and the trio is below there. 如果选择“检查元素”,然后将鼠标悬停在<section id="content">您会看到它停在幻灯片的下方,并且三重奏位于下方。 I think the solution is to do margin: [height of trio plus margins, borders, etc] + 50px 0 50px 0; 我认为解决方案是做margin: [height of trio plus margins, borders, etc] + 50px 0 50px 0;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM