Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prevent linebreaks between two elements

Tags:

html

css

I have this html with css: http://jsfiddle.net/krhxG/

I set the width of the div to 20px in purpose in order to explain what I need.
How can I prevent from the submit button to break the line?
I want both the controls to be as one without line breaks at all. How can I do it?

like image 705
Naor Avatar asked Mar 20 '26 05:03

Naor


2 Answers

How can I prevent from the submit button to break the line?

With a white-space: nowrap; on the parent <div> See updated jsfiddle.

like image 78
BalusC Avatar answered Mar 21 '26 23:03

BalusC


In your container div, you need a white-space property:

<div style="white-space:nowrap;">
<input type="text" /><input type="submit" value=""/>
</div>
like image 29
Jage Avatar answered Mar 21 '26 22:03

Jage