Tuesday, 6 August 2013

Floated Divs not wrapping correctly when select is last item on line

Floated Divs not wrapping correctly when select is last item on line

I am floating divs that contain either a textbox or select element. I want
the divs to wrap to the next line when it runs out of space. This works
fine when the last element of the line is a text box, but not when its a
select. You can resize your browser to see the result.
example html:
<div
style="display:block;float:left;padding-right:5px;vertical-align:bottom;padding-bottom:2px;">
<span>Text1</span>
<br>
<input id="TextBox" type="text" tabindex="-1" size="3" value="1">
</div>
JS Fiddle: http://jsfiddle.net/NsxJM/

No comments:

Post a Comment