The reason your code wasn't working is because floating divs don't affect the size of the surrounding element. The problem you get with inline-block on your left side float is that you lose one of your headers as the screen is made smaller. I shrank the screen size on the JSfiddle Mehmet Eren Yener provided and the right header disappears. If your headers are long, and the screen is small - the right header will vanish.
I think the better approach would be to either use a clearfix class or to use the overflow tag. There's also the Empty Div Method - but I'm not really a fan of that one. If you use one of these methods instead the left header will stack on top of the right header when they get too close.
Here are examples of using Clearfix and Overflow:
Clearfix: http://jsfiddle.net/ATP33/
HTML:
<div id="expand-box">
<div id="expand-box-header" class="clearfix">
<span style="float: left;">Top left header</span>
<span style="float: right;">Top right header</span>
</div>
<div id="expand_box_sub_header">Lorem ipsum dorem nori seota ostiy</div>
</div>
CSS:
#expand-box {
width: 100%;
padding: 0;
border: 2px solid #BBB;
margin: 7px 0 0 0;}
#expand-box-header {
background-color: #BBB;
margin: 0;
color: #FFF;
padding: 0 0 3px 2px;}
#expand_box_sub_header { clear: both; }
.clearfix:after { content: "\00A0"; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
.clearfix{ display: inline-block;}
html[xmlns] .clearfix { display: block;}
* html .clearfix{ height: 1%;}
.clearfix {display: block}
Overflow: http://jsfiddle.net/RL8ta/
HTML:
<div id="expand-box">
<div id="expand-box-header">
<span style="float: left;">Top left header</span>
<span style="float: right;">Top right header</span>
</div>
<div id="expand_box_sub_header">Lorem ipsum dorem nori seota ostiy</div>
</div>
CSS:
#expand-box {
width: 100%;
padding: 0;
border: 2px solid #BBB;
margin: 7px 0 0 0;}
#expand-box-header {
background-color: #BBB;
margin: 0;
color: #FFF;
padding: 0 0 3px 2px;
overflow: auto;}
#expand_box_sub_header { clear: both; }