html - Bootstrap : Prevent 'wells' from wrapping

标签 html css twitter-bootstrap

在我当前使用 bootstrap 的网站上,我有一组 ' wells ' 在 container-fluid 内。我想要达到的效果是让每口井并排成一排。这对于几口井来说已经很好了。然而,现在我添加了更多的孔,并开始在更小的分辨率上进行测试。

现在,当孔到达浏览器窗口的边缘时,它们会环绕。这不是我想要的行为。相反,我希望出现一个水平条,并允许用户侧向滚动以查看其余的孔。所有孔都应位于同一行,无论屏幕分辨率、孔数量以及孔内容物的宽度如何。

这是一段简短的代码,可让您了解我的结构:

<div class="container-fluid">
  <div class="row">
    <div class="span">
      <div id="pipelinesPackagesViewPane" class="well well-sm">
        <h2> Well 1 </h2>
        <p> Long line of texxxtttttttttttttt </p>
      </div>
    </div>
    <div class="span">
      <div id="pipelinesPackagesViewPane" class="well well-sm">
        <h2> Well 2 </h2>
        <p> Long line of texxxtttttttttttttt </p>
      </div>
    </div>
    <div class="span">
      <div id="pipelinesPackagesViewPane" class="well well-sm">
        <h2> Well 3 </h2>
        <p> Long line of texxxtttttttttttttt </p>
      </div>
    </div>
    <!-- MORE WELLS HERE -->
  </div>
</div>

我使用的容器正确吗?如何才能实现“不换行”行结果?

谢谢!

最佳答案

您可能需要一些自定义 CSS 才能使用以下命令获得结果:

<div class="container-fluid">
  <div class="row wells"> // ADD Class "wells"
    <div class="span">

然后在CSS

.row.wells {
  white-space:nowrap;
  overflow:auto;
    }
.span {
  display:inline-block;
 }

检查这个Demo

关于html - Bootstrap : Prevent 'wells' from wrapping,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26515977/

相关文章:

html - Bootstrap 侧边栏折叠菜单 :after

html - CSS - 按钮不填充表格单元格

jquery - 当内容改变时调整父级的高度?

html和css识别元素

CSS Ribbon - 如何在忽略背景的情况下制作透明三 Angular 形

html - 如何将箭头添加到div?

javascript - Ionic 4 D3 样式与 scss 类

html 帮助程序链接在 ie 中不起作用

html - 如何垂直对齐 td 和 span 中的文本?

javascript - Bootstrap 模式无法正确加载