I am trying to display three textfields on one line. When screen is smaller then these textfields should be displayed in the same line. Currently when I make my browser smaller then textfields move to the second line.
How can I achieve this?
please see my code
HTML
<div class="fields">
<input type="text" class="name" />
<span>–</span>
<input type="text" class="name" />
<input type="text" class="name2" />
</div>
CSS
.fields {
border: 1px solid grey;
width: 23%;
}
.name {
display: inline;
width: 11ex;
}
.name2 {
display: inline;
width: 8ex;
}
Give white-space:nowrap; to your
.fieldsDIV. Write like this:Check this http://jsfiddle.net/6tkF8/1/