Browser incompatibility is a horrible menace and it can't be evaded at least while we still have companies like MSFT that will rather prefer to create their own standards and follow others. However, there are safe practices that can be followed to minimize problems arising from browser incompatibilities.
One of them is to use well developed CSS frameworks. I tend to drift towards Blueprint -
http://code.google.com/p/blueprintcss/. There are a lot more other CSS frameworks out there that you can use for your apps. Using a CSS framework will save you from having to do a lot of CSS hacks since they have already been incorporated.
Secondly, if you do lots of AJAXy kind of activity in your apps, instead of writing your own XHR routines, you are better of using a mature library for that. Examples include
jQuery (my favorite),
Dojo,
Script.aculo.us and
MooTools.
Third, avoid using clever Javascripts. You're better off using the Javascript libraries to do your DOM modifications than doing it yourself.
Fourth, the W3C standards are great. Ensure your HTML/XHTML are well-formed and pass the syntax checks and so on.