I have this html with css: http://jsfiddle.net/krhxG/
I set the div width to 20 pixels specifically to explain what I need.How can I prevent the submit button from breaking the line?I want both controls to be as one without line breaks. How can i do this?
How can I prevent the submit button from breaking the line?
C white-space: nowrap;in parent <div> See updated jsfiddle .
white-space: nowrap;
<div>
In your div container, you need a white space property:
<div style="white-space:nowrap;"> <input type="text" /><input type="submit" value=""/> </div>
@BalusC (, html, JavaScript), :
.wrapper{ width: 290px; white-space: no-wrap; resize:both; overflow:auto; border: 1px solid gray; } .breakable-text{ display: inline; white-space: no-wrap; } .no-break-before { padding-left: 10px; }
<div class="wrapper"> <span class="breakable-text">Lorem dorem tralalalala LAST_WORD</span>‍<span class="no-break-before">TOGETHER</span> </div>