I was fixing up some xhtml/css for someone earlier and noticed a few common mistakes that I've seen a number of developers make, so I thought I'd start a thread so we can all share our IE/FF/Cross-browser tips and tricks
.
Here are two that I can think of:
1. If you are using floating elements, always set the containing element’s width and overflow property. Overflow = hidden is what I usually use. Note: IE requires the width and FF requires the overflow otherwise the containing element (usually a div for me) doesn't have a height unless u add non floating elements.
2. To centre align a block level element set its width according, then set its margin-left and margin-right to auto.