How do I right align div elements?

MEURSAULT picture MEURSAULT · Oct 7, 2011 · Viewed 1.1M times · Source

The body of my html document consists of 3 elements, a button, a form, and a canvas. I want the button and the form to be right aligned and the canvas to stay left aligned. The problem is when I try to align the first two elements, they no longer follow each other and instead are next to each other horizontally?, heres the code I have so far, I want the form to follow directly after the button on the right with no space in between.

Answer

pstanton picture pstanton · Sep 8, 2012

floats are ok, but problematic with ie6 & 7.

i'd prefer to use margin-left:auto; margin-right:0; on the inner div.