Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This line in reset.css adds 1-2 pixels of white space at the bottom of the <body>
element:
body {
line-height: 1;
}
Removing line-height: 1;
fixes the problem. I've attached before/after shots to illustrate.
Comment | File | Size | Author |
---|---|---|---|
#5 | reset_pixel_error_no_clearfix.png | 10.75 KB | Todd Nienkerk |
reset_pixel_error_after.png | 12.11 KB | Todd Nienkerk | |
reset_pixel_error_before.png | 11.32 KB | Todd Nienkerk |
Comments
Comment #1
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedAlso, this can't be overridden in another CSS file. The line has to be removed from reset.css completely in order to close the gap.
Comment #2
Christopher Herberte CreditAttribution: Christopher Herberte commentedCould we do without the reset.css? It causes many headaches and I keep wondering is it really necessary?
Comment #3
dvessel CreditAttribution: dvessel commentedI suspect it's due to the clearfix class + the line height. But yeah, this should be rethought so nothing seems forced. For now, just add this into your sub-theme's .info file to remove it.
Without the file in your sub-theme, it'll be omitted.
Comment #4
Christopher Herberte CreditAttribution: Christopher Herberte commentedYep, this is the first thing I do when creating a new sub-theme or theme base on 960. Maybe this is for a new topic but it would be nice to see a "show of hands", for and against the use of reset.css (period) -- A "nay" from me :P
Comment #5
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedI like reset.css, so I just commented out that one line.
@dvessel re: #3: I tested this without the clearfix method and still found an additional pixel at the bottom of the page. (I only tested this in Firefox, though.) See attached screenshot.
Comment #6
Todd Nienkerk CreditAttribution: Todd Nienkerk commentedAdded warning to reset.css in 6.x-1.x-dev and 7.x-1.x-dev.
Comment #7
dvessel CreditAttribution: dvessel commentedNot sure this will still show after syncing with the latest 960.gs source since it uses another clearfix method. That body line-height was overwritten as well.
I think I'll also make it an option to include the reset file. I have some code in place to allow it to be configured from a subtheme. Just need to hook it in.
Comment #8
michaelfillier CreditAttribution: michaelfillier commentedI am not sure what is causing my problem, but I noticed that my ninesixty sub-themes have a space (larger than 1-2px) on the bottom that I cannot figure out! See: http://maiaandassociates.ca
I am having the same problem on a development site and I cannot get it to go away. Any help would be tremendously appreciated.
Comment #9
dvessel CreditAttribution: dvessel commented@michaelfillier Look at #footer-sub and the .clear-block you added to that. Remove it. It's not related to the reset.css from the theme. It's a combination of Drupal core's .clear-block and the line-height you added to the body.