I have the following situation .. I'm working on a responsive layout that has three columns, left sidebar, center and right ... It happens that inside the right sidebar there is a text field and next to it there should be a submit button ... This button can never break the line, so I used in the div (inside the sidebar) where this form is the property white -space: nowrap;
The problem is that I would like the button element to be fixed in its width and the text field to be flexible, but when the dimensions are varied this does not happen, or it grows too big, popping up the layout or gets too small, leaving space inside the sidebar. Is there any way to resolve this?
The code is as follows:
div#sidebar {
width: 23%;
}
div#sidebar div#searchbox {
display: block;
padding: 3px 5px;
margin-bottom: 4px;
white-space: nowrap;
}
div#sidebar div#searchbox input[type="text"] {
width: 100%;
}
div#sidebar div#searchbox input[type="submit"] {
width: 85px;
}
HTML:
<div id="sidebar">
<div id="searchbox">
<input type="text" name="query" />
<input type="submit" name="btn-submit" />
</div>
</div>