Reputation: 7310
I have a div container and a span container very close to each other (span on the left, div on the right). Is there a way for the span to realize when it is within, lets say 5px, of the div so that it goes to the next line?
In the diagram, the left box is where the span containers will be containing text. The right box is the div container that text can not go on
_______________________
| |
| |
| |
| |
| |
| |
| |
| |
| |
| -----------------------
| | |
| | |
| | |
| | |
| | |
_______________| |
| |
| |
| |
-----------------------
Upvotes: 1
Views: 4060
Reputation: 1437
Stick the span inside another div and put a float on it
html:
<div class="LeftFloat">
<span>
</span>
<div>
CSS:
.LeftFloat
{
float:left;
}
Upvotes: 1