简体   繁体   中英

Eliminating white space at bottom of page

Originally I had a background image that appeared as a gradient background. Wanting to have a solid black backgound I removed link to background image/repeat x. The result is a large white space at bottom of page. I have searched quite a few answers to this common problem but none have helped me figure this out.

This is an .php site so if there is an html .div then I cannot find it but in css stylesheet it just reads as #top-bg with background: #000000

I have tried adding in height: 100%; not sure where to adjust margins as recommended by some sites. Any help would be greatly appreciated!

body, html{
    padding:0!important; 
    margin:0 !important;

    background:#000;//is this what you want?
}

for start have you think to remove defaukt browser padding and margin?

html{
    margin: 0;
    padding: 0;
}

Also, where is define your background?

  • in your first div?
  • in your body?
  • in your HTML ?

for better, background was define in your body tag :

body{
    background-color: #FCC; /* for test */
}

If you have no padding, no margin, this code working for you...

Try this

body, html {

background:#000;
height:100%;
padding:0;
margin:0


}
html {
  background:#000;
}

This was sufficient for me to remove white space.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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