6 Years
Discussion Span
Last Post by dany12

Well, you can place two divs side by side if you use this CSS rule on both and the widths combined aren't too wide for the containing element.

display: inline-block;

Other use float: right; on the div you want on the right. Float can have some unexpected effects though depending on the page structure.


I wouldnt suggest that you use the margin properties for that purpose. The problem with using the margin property in this way is that you'll have all sorts of unexpected display issues (elements shifting) especially when you do not have a "wrapper" div that is centered in the middle of the page.

You can have divs line up against each other traditionally using the float property such as:

#div1 {float:left;width:50%}
#div2 {float:right:width:50%}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.