How do you make containers with floating elements block around the floating elements
Here is the HTML.
<div>
<label> foo </label>
<input type="text" />
</div>
<div>
<label> foo </label>
<input type="text" />
</div>
And CSS
input {
height: 50px;
float: right;
clear: right;
}
And it displays like so :
|------------------------------------------------------|
| foo -----------------|
|-------------------------------------|---------------||
| foo | |
|-------------------------------------|---------------|
|---------------|
|---------------|
| |
| |
| |
|---------------|
I would like it to display like :
|------------------------------------------------------|
| foo -----------------|
| | ||
| | ||
| | ||
| |---------------||
|------------------------------------------------------|
| foo |---------------||
| | ||
| | ||
| | ||
| |---------------||
|------------------------------------------------------|
What is the correct CSS trickery to fix this?