MKP
MKP

Reputation: 117

bootstrap span and input full width in the same line

How can I put in the same line a span and an input with a full width for both elements?

<div class="row">
  <div class="col-xs-12">
    <span>Description</span>
    <input id="txtDesc" type="text"/>
 </div>
</div>

#txtDesc {
  width: 100%;
 }

https://jsfiddle.net/e4qvb7ck/

Thanks in advance!

Upvotes: 1

Views: 1123

Answers (1)

K K
K K

Reputation: 18099

Give white-space:nowrap to the container of both elements:

CSS:

.col-xs-12 {
    white-space: nowrap;
}

Demo: http://jsfiddle.net/GCu2D/1179/

Upvotes: 1

Related Questions