Forum Moderators: not2easy
The fix is as fallows:
This should be the very first rule in your style sheet.
* {
padding:0px;
margin:0px;
}
What this does is it erases all the extra “automatic” padding and margins created by some elements that all browsers may interpret differently. These elements include, but are not limited to:
p, h1, h2, h3…, ul, ol, dl, dt, dd, body, and any other elements that create its own padding and/or margins.
This also means that you will need to apply rules to each of these as you use them.
If you do this you should be able to avoid the simplest fixes and hacks (uh-hem…IE)
FYI: form elements will retain their default margins and/or margins.
* {
margin:0;
padding:0;
}
Note there is no need to add the unit on "0".
Just remember that if you need e.g. a <ul> to work again you need to give it some padding on the left to allow for space for the bullets
ul { padding-left: 2em;} does the trick nicely. I prefer this as it's far less code than the more elaborate reset by Eric Meyer. And any code you've written yourself has a far better chance of being understood completely than code you borrowed (with permission of course).