html - bootstrap span 和 input full width 在同一行

标签 html css twitter-bootstrap-3

如何在同一行中为两个元素放置跨度和全宽输入?

<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/

提前致谢!

最佳答案

white-space:nowrap 赋给两个元素的容器:

CSS:

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

演示: http://jsfiddle.net/GCu2D/1179/

关于html - bootstrap span 和 input full width 在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36150840/

相关文章:

jquery - Bootstrap 下拉菜单充当 block 级元素

javascript - 避免影响加载列表

html -::before 和::after 伪元素问题

javascript - 我如何在 ng-model AngularJS 中使用过滤器

html - 如何让 <li> 的子元素以 100% 的高度显示?

html - Div bg 与 Body bg 不匹配

html - 搜索框在调整大小时使导航栏的高度加倍

html - col-md-2 最后一列不在同一行

javascript - 在 JavaScript 中成功验证后我无法显示任何消息

javascript - 使用 Clipboard.js 复制跨度文本