Well here's the most basic but useful trick.
First off, make sure you have a DOCTYPE. A doctype forces browsers (especially IE) to use the Standards Mode and will a lot of things your site might be having. IE is horrible with Quirks Mode, which is when you don't have a doctype on your site and so it doesn't use the standards of xhtml/css.
Once you got the right doctype, you have to reset margins and stuff with css. It is best to set the html and body margins and padding to 0 pixels, here's an example:
<style type="text/css">
html { margin: 0px; padding: 0px; }
body { margin: 0px; padding: 0px; }
</style>
That is the most you might ever need, however doesn't reset it on everything, such as headings or divs. You can simply reset them when you give some an id (ex: <div id="example"> ) or just do it right away. Example:
div { margin: 0px; padding: 0px; }
or alternatively...
div#example { margin: 0px; padding: 0px; .... }
Don't want to deal with all of that? You can easily set all the tags to have zero-margins and padding with the selector, ex:
<style> * { margin: 0px; padding: 0px; } </style>
However, be careful with the universal selector since other problems may occur (some did for me). I think it's the lazy method, you can actually google some "reset browser margins" examples and they might give you a stylesheet with all the tags you might use and resets them to zero.
Also the easiest way to achieve a cross browser site is to check your site often in every major browser and see how it looks instead of designing your site for one browser and then dealing with bugs later. Additionally, you don't need to check your site in every browser actually. The main ones are Firefox and Internet Explorer which you should definitely check, and Chrome and Safari use the same engine so you only need to pick one of them, and then there's Opera which sometimes acts like IE (font sizes).
That's all I got so far, also make sure to keep things standard and be patient. You may not find out the answer for IE's weird behaviors' (or other browsers) at first, but it will come to you don't worry.














