Reputation: 2869
I have the following HTML. And the text (tidbit) on the right keeps dropping off to the next line. This is in chrome. Is there a way to keep what is inside of the pull-right div together in one line? here is the jsFiddle.
<div class="container" style="width:500px;>
<div class="controls controls-row">
<span class="add-on">This can be quite long</span>
<div class="pull-right">
<input class="input-mini" name="Amount" type="number" />
<button type="button" class="btn" style="margin-bottom: 10px">Add</button>
<div style="text-align:right; width:40px;">tidbit</div>
</div>
</div>
</diV>
Upvotes: 6
Views: 21452
Reputation: 885
What is the combined width of div class pullright controls. It is exceeding 500px i think.
If width of these 3 exceeds 500px, tidbit text will move to next line. So control width
Upvotes: 0
Reputation: 2201
Remove the div tag around tidbit and, if necessary, wrap the tidbit in a span - JSfiddle
<div class="container" style="width:500px;>
<div class="controls controls-row">
<span class="add-on">This can be quite long</span>
<div class="pull-right">
<input class="input-mini" name="Amount" type="number" />
<button type="button" class="btn" style="margin-bottom: 10px">Add</button>
<span>tidbit</span><!--Move this the before or after the button-->
</div>
</div>
</diV>
Upvotes: 0
Reputation: 74096
You can do this with two corrections:
display: inline-block
in the "tidbit" div.white-space: nowrap
to the pull-right
container.
<div class="container" style="width:500px;>
<div class="controls controls-row">
<span class="add-on">This can be quite long</span>
<div class="pull-right">
<input class="input-mini" name="Amount" type="number" />
<button type="button" class="btn" style="margin-bottom: 10px">Add</button>
<div style="text-align:right; width:40px; display: inline-block;">tidbit</div>
</div>
</div>
</diV>
.pull-right{
white-space:nowrap;
}
Upvotes: 7
Reputation: 33628
You can perhaps add pull-left and pull-right inside the pull-right parent container
<div class="container" style="width:500px;">
<div class="controls controls-row"> <span class="add-on">This can be quite long</span>
<div class="pull-right">
<div class="pull-left">
<input class="input-mini" name="Amount" type="number" />
<button type="button" class="btn" style="margin-bottom: 10px">Add</button>
</div>
<div class="pull-right" style="text-align:right; width:40px;">tidbit</div>
</div>
</div>
</diV>
Hope this helps
Upvotes: 5