CSS white space at bottom of page despite having both min-height and height tag

后端 未结 10 1928
花落未央
花落未央 2020-12-23 20:35

I am unable to get the white space at the bottom of this page to disappear. I have both min-height and height tags in body. Any suggestions? Thanks!

http://womanc

10条回答
  •  悲哀的现实
    2020-12-23 20:39

    I find it quite remarkable that out of 6 answers, none of them have mentioned the real source of the problem.

    Collapsing margins on the last p inside #fw-footer is where that extra space is originating from.

    A sensible fix would be to add overflow: hidden to #fw-footer (or simply add margin: 0 on the last p).

    You could also just move the script inside that last p outside of the p, and then remove the p entirely; there's no need to wrap a script in a p. The first p (#fw-foottext) has margin: 0 applied, so the problem won't happen with that one.


    As an aside, you've broken the fix I gave you in this question:

    CSS3 gradient background with unwanted white space at bottom

    You need html { height: 100% } and body { min-height: 100% }.

    At the moment, you have html { height: auto } being applied, which does not work:

    (This happens with a window taller than the content on the page)

提交回复
热议问题