自举跨度并在同一行中输入完整宽度 [英] bootstrap span and input full width in the same line

查看:97
本文介绍了自举跨度并在同一行中输入完整宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < p>如何在同一行中放置一个跨度和两个元素的全宽输入? div class =row> 
< div class =col-xs-12>
< span>说明< / span>
< input id =txtDesctype =text/>
< / div>
< / div>

#txtDesc {
width:100%;
}

https://jsfiddle.net/e4qvb7ck/

预先致谢!

>解决方案

给code> white-space:nowrap 添加到两个元素的容器中:

CSS:

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

演示:

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!

解决方案

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

CSS:

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

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

这篇关于自举跨度并在同一行中输入完整宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆