Floated element must never get out of the div
Following my code:
HTML:
<div>aaaaaaaaaaaaaaa
<span>test</span>
</div>
CSS:
div{
width: 60px;
border-bottom: 1px solid red;
word-break:break-all;
}
span{
float: right
}
I would get this result: http://oi41.tinypic.com/2py25w1.jpg
I would like the text right-floated should not have to get out the div, so
it must go to a new line inside the div when needed, as in the code that I
posted. In this case, for example, there is no need to let go of the text
in a new line, because the text fits on the right of the text:
http://jsfiddle.net/3kRan/2/
No comments:
Post a Comment