Feature # 1: blocks order is important for float!

Two <div> blocks; located sequentially. Value float: right is set for the second block div.second. A block is on a right edge: The first block is not affected, it the same occupies all free content of parent on a width. It is necessary, that blocks were on the same level.

Solution. Changing of blocks' places in HTML code.

HTML code:

<div class="first">
    ...
</div>
<div class="second">
    ...
</div>

Live example ↓

First div.first

.first
{
    border: 2px solid #33F;
}

Second div.second

.second
{
    border: 2px solid #F00;
    float: right;
}
Window size: 1920 x 1166
Viewport size: 1920 x 1038