css - 调整大小后列中的 Bootstrap 跨度溢出

标签 css twitter-bootstrap-3

col-sm-1 有一个 span 元素,class 是 label,col-sm-11 有一个段落 (p)。

Here is fiddle link. PS:中心分隔线需要向左拉才能重现这种情况。

当谈到调整大小时,网格表现得像

  • first label overlaps on col-sm-11 p
  • than label and p goes to seperate blocks

有没有办法在不改变元素结构的情况下避免这种情况?

任何帮助将不胜感激

<div class='container'>
    <div class="row">
        <div class="col-sm-1">
            <span class="label label-default">Lorem Ipsum </span>
        </div>
        <div class="col-sm-11">
            <p>
                <a>Test link </a>
            </p>
        </div>
    </div>
</div>

Screenshot off fiddle after resizing

最佳答案

试试这个。您增加 col-sm-2,然后再次回退到 col-md-1,这样您将有更多空间用于标签夹的小设备。

<div class='container'>
    <div class="row">
        <div class="col-sm-2 col-md-1">
            <span class="label label-default">Lorem Ipsum </span>
        </div>
        <div class="col-sm-10 col-md-11">
            <p>
                <a>Test link </a>
            </p>
        </div>
    </div>
</div>

关于css - 调整大小后列中的 Bootstrap 跨度溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30483509/

相关文章:

html - Lato 字体在 Firefox 中损坏

html - 为什么 Bootstrap 的选择列表在 google chrome 的开发人员工具移动 View (响应式)选项中不起作用?这是BUG还是其他什么?

html - 如何在 Bootstrap 中实现响应式、独立滚动的 Pane ?

jquery - 当一个元素有 onclick 处理程序时,不会触发 Bootstrap 折叠

css - 需要使用 CSS 样式绘制两个具有相同原点(相同中心点)的圆

javascript - Angular Material 布局错误?卡片重叠

asp.net - Bootstrap中的body-content类是什么

angularjs - Bootstrap v3.3.6 下拉子菜单项在移动端不展开

php - WordPress:帖子 ID 自定义 CSS

css - 形状、移动、定位