Several things happen here: firstly, your width in the “registercontainer” div is 1050, which will make it clear, which will cause the “register” div to appear under the “centered” div.
I would go about it differently. If you are dealing with a fixed-width site: I would put #login and #registercontainer next to each other and give #wrapper an explicit width. Then set #wrapper to leave a margin on the left, using%, which will roughly correspond to the placement you are after.
See the JS Fiddle example for an example . Here is the CSS (I changed the background colors for clarity):
body { background: rgba(0, 0, 0, 0.8); font-family: sans-serif; font-size: 11px; color: #e0e0e0; width: 960px; } #wrapper { width: 760px; background: blue; overflow: hidden; margin-left: 35%; } #login { float: left; margin-top: 50px; background: rgba(0, 0, 0, 0.9); width: 360px; padding: 20px; -webkit-border-radius: 15px; border-radius: 15px; } #registercontainer { float:left; margin-top: 50px; clear: none; width: 350px; background: red; } #register { }
source share