Eliminating white space at bottom of page

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

    background:#000;//is this what you want?
}
Share:
17,683
user1584161
Author by

user1584161

Updated on June 23, 2022

Comments

  • user1584161
    user1584161 about 2 years

    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!

  • user1584161
    user1584161 almost 12 years
    There were 2 separate sections above top-bg. One named html and the other body. Both already had magin 0 and padding 0 so I added background and height as you suggested above and it worked! Thank you SO much!
  • Jitender
    Jitender almost 12 years
    Glad I could help, body and html does have 100% height by default we need to set it. Also please mark my answer as correct answer :)
  • samuraiseoul
    samuraiseoul over 7 years
    Thanks, that immportant and doing it as a css reset on * is what got me going!