Remove white space under footer [closed]

2019-04-15 04:00发布

How to remove white space under footer bar? I already remove padding:15px under footer, but its not working.

Here's the site

CSS

#bottom-footer{ 
background: #909090;
text-transform: initial;
padding: 15px;
font-family: 'Arial', 'sans-serif';
color: #000000;
font-weight: 300;
}
#bottom-footer .site-info{
float: left;
font-size: 14px;
color: #000;
line-height: 1.8;
}
#bottom-footer .site-page{
float: right;
font-size: 14px;
line-height: 1.8;
color:#D00000;
}
#bottom-footer .copyright{
float: right;
padding-top:20px;
margin-left:600px;
}
#bottom-footer .logos{
float: left;
padding-top:20px;
margin-right:50px;
}

标签: css css3 layout
3条回答
Ridiculous、
2楼-- · 2019-04-15 04:38

Or you can use this http://ryanfait.com/html5-sticky-footer/

Keeps footer always to the bottom


* {
        margin: 0;
}
html, body {
        height: 100%;
}
.wrapper {
        min-height: 100%;
        margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */
}
footer, .push {
        height: 155px; /* '.push' must be the same height as 'footer' */
}

/*
查看更多
乱世女痞
3楼-- · 2019-04-15 04:41

I'm assuming you want your footer to stick to the bottom of the window except for when the content is higher then the window.. I suggest a few things:

  1. Fix your html, for example, all your content is inside your header tag, that's probably a mistake.

  2. To make your footer work correctly, I would use the css calc method to give your content a minimum height of 100% minus the height of your header+footer, as such (notice also a few important css rules to make this work):

html,body,#page,header { height:100%;}

#content {
  min-height: calc(100% - 285px); // 285 should be the height of your header + height of footer.
}

** Notice that calc method needs to be written exactly as above (spaces and all) to work.. browser support link

Option 2

Another way you can achieve this:

html,body,#page, header { height:100%;}

#page { position:relative;}
#content { padding-bottom:130px;} /* FOOTER HEIGHT */
footer { position:absolute; bottom:0;}

If you have any question feel free..

查看更多
趁早两清
4楼-- · 2019-04-15 04:52

Try giving dynamic margin-bottom value to your #content

So the margin-bottom value will be same as the height of your footer

查看更多
登录 后发表回答