This seems to be more an issue with HTML and CSS than JavaScript.
The first thing one should do before trying to fix layout issues is to check if the current markup is valid. This is easy to do by using the validators over at W3C,
http://validator.w3.org/.
Simply imput your page URL or upload a file and you'll get a list of things to fix to make your markup standards compliant. After checking the HTML you should also check the CSS (click "other validators and tools).
Then you're most likely up for the task of not trying to get a headache over the differences in browser implementations/interpretations (and sometimes complete disregard) of those standards.
The guys hanging out in the CSS section here should be able to provide you with more detailed help when you encounter a problem the validators can't detect, so I'll move this thread there.
Btw, there's an extension for Firefox called Firebug, it's invaluable to have when it comes to manipulating and debugging HTML, CSS, scripts etc on the actual page as it also helps you out with the syntax. Together with the Web Developer Toolbar you'll get much better control of your site.