You have to set a container div with a specified width say 800px.
Then suppose you need to have two other divs inside first one of 400px each, remember not to exceed 800px of the combined width of 2 divs, even though you include a border of 1px with this two divs it will break off, since 400+400+borderwidth > 800px.
Checkout the code below:
<!-- Code Begins -->
<html>
<head><title>HTML div example</title></head>
<body>
<!-- Container div starts -->
<div style="width:800px">
<!-- div 1 -->
<div style="width:400px;height:100px;float:left;background-color:#CCC;text-align:center;">div1</div>
<!-- div 2 -->
<div style="width:400px;height:100px;float:left;background-color:#999;text-align:center;">div2</div>
</div>
<!-- Container div ends -->
</body>
</html>
<!-- Code Ends -->
Feb 2, 2010