简体   繁体   English

可以超过父列的列数吗?

[英]Is it ok to exceed the number of columns of the parent column?

I have the following layout, using Twitter Bootstrap: 我使用Twitter Bootstrap具有以下布局:

<div class="row">
    <div class="span8">
        <div class="row">
            <div class="span2"><img src="..."></div>
            <div class="span2"><img src="..."></div>
            <div class="span2"><img src="..."></div>
            <div class="span2"><img src="..."></div>
        </div>
    </div>

    <div class="span4">
        ...
    </div>
</div>

When I need to display more than 4 <img> , I can just create another row . 当我需要显示4个以上的<img> ,我可以只创建另一row But I've noticed that when I use more than 4 span2 inside the span8 , even without creating another row , it correctly splits them across several lines, rendering the same as if I had manually added the extra row s. 但我注意到,当我使用超过4 span2的内部span8 ,即使没有创建另一个row ,它正确地分割他们跨越几行,渲染一样的,如果我手动添加额外的row秒。

Is this a documented practice, or is it just working incidentally, and could have drawbacks in some situations / with some browsers? 这是有记录的做法,还是只是偶然地起作用,并且在某些情况下/某些浏览器中可能存在缺点?

It's OK and it's documented. 没关系,并已记录在案。 Take a look at thumbnails section of the docs, you'll see an example of this practice. 查看文档的缩略图部分 ,您将看到此做法的示例。
By the way, if you are showing a collection of images you should be using thumbnails . 顺便说一句,如果要显示图像集合,则应使用thumbnails

EDIT: Despite of everything, there's a known issue when doing this inside a row-fluid . 编辑:尽管有很多,但是row-fluid执行此操作时存在一个已知问题。 So there's only support for static content right now. 因此,目前仅支持静态内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM