Is there a way to limit the scope of CSS float and clear?

Example problem with: http://jsfiddle.net/xZmFg/4/

Of course, there is a way to get a description so that you can immediately follow the inputs (below, not to the right), and not end up under the menu ...

I understand that with "float" you exit the content stream, but is there no way to apply only to the space inside the parent container?

+5
source share
2 answers

You can indicate that the parent of the description and form contains all their floats with overflow: hidden:

.content-box {
    overflow: hidden;
}

Thus, they will not interfere with floats on the elements of the side panel.

JsFiddle preview

+14
source

:

.content {
    float: left;
}

clear: left; .description, ( ).

http://jsfiddle.net/ambiguous/QdY44/

+1

All Articles