MidiMagic, I think, well actually, I know each of the above comments are incorrect. I've used 0px for styles on all the websites I've built and likewise, I've used margin, padding and borders in a single stylesheet element for a lot of those sites.
All my websites validate to W3C HTML 4.01 strict and CSS standards with 0 errors or warnings. So, if 0px is an invalid style, it would have been picked up. Likewise, I am pleased to say that my websites using these stylesheets are pixel perfect between FFX2, FFX3, IE6, IE7, Netscape, Opera and Safari.
Just some food for thought.
0px, 0pt, and other zero values with dimensions kick Firefox into quirks mode, and often prevents the style containing it from operating. It shows up as an error in the Firefox error console. It works, but in quirks mode.
But note that I use XHTML 1.0 Strict. This might be a deprecation in XHTML, but it is not caught by the W3C validator.
I use 4 tests on each page I produce or refurbish:
- Spellcheck
- W3C validation
- Browser rendering correctness and differences between browsers
- Firefox Error Console
---
You misread the part about the margins, borders, and padding. What does not work right is putting size styles (width, height) in the SAME tag that has nonzero surrounding styles (margin, border, padding). Nest two tags if you need both kinds of styles.
This second item is NOT a matter of validation, and it causes no browser errors. It causes those maddening rendering differences between IE and FF. IE wrongly puts the surrounding styles INSIDE the size measurements, unlike the other browsers that obey the standard. Nesting tags lets you force the order you want.