Here is html code:
‹/div› ‹!--close parentContainer--›
How does the float work?
First, let’s try to find out how does the float work.
Content flows down the right side of a left-floated box
Content flows down the left side of a right-floated box
Since a float is not in the flow, non-positioned block boxes created before and after the float box flow vertically as if the float didn’t exist.
Floats cause other floated elements and inline content to flow around the float, but other block boxes ignore the float.
In other words floats are taken out of the normal flow in relation to sibling block elements.
Here we define the parent or container div
float: left for the child1
float: none and overflow: hidden for the child2
Here is css code:
This solution can be found here.