The key to creating webpages that perform consistently in all browsers is to use a complete <!DOCTYPE> statement to set the browser to "Standards Compliance Mode". Search on "DOCTYPE switch" and you'll find some good information on choosing a <!DOCTYPE> statement.
The second step is to understand that even in Standards Compliance Mode, browsers have different default settings for margin, padding, and more. Search on "CSS Reset" and you'll find some good examples of ways to further minimize the differences among browsers. Good luck!