twitter bootstrap,容器类不可嵌套 [英] twitter bootstrap, container class is not nestable

查看:23
本文介绍了twitter bootstrap,容器类不可嵌套的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

bootstrap 3 容器类的文档 指出,由于填充等原因,两个容器都不可嵌套".
但是,在官方的例子中,拿这个,一个简单的导航栏的演示,我们看到了一些东西喜欢:

The documentation of the bootstrap 3 container class states that 'due to padding and more, neither container is nestable".
But then, in the official examples, take this, a demo of a simple navbar, we see something like:

<body>
<div class="container">

  <nav class="navbar navbar-default">
    <div class="container-fluid">
      <div class="navbar-header">

容器流体明显嵌套在容器内.我对两个容器都不是可嵌套的"这句话的理解是,我们应该在一个页面中只有一个容器,或者另一方面,如果它们没有嵌套在另一个中,我们可以有多个.
看例子好像不是这样,那这个约束是什么意思呢?我也阅读了这个问题和其他一些问题,但他们没有谈论嵌套问题.

where a container-fluid is clearly nested inside a a container. My understanding of the "neither container is nestable" sentence is that we should have just one container in a page, or on the other hand we can have multiple if they are not nested one within the other.
Seeing the examples it doesn't seem to be the case, then what does it mean that constraint? I've read also this question and some others but they don't talk about the nesting thing.

推荐答案

此问题已在 Bootstrap 存储库中提出:

This has been brought up as in issue on the Bootstrap repo:

https://github.com/twbs/bootstrap/issues/15512

我不确定文档是否会相应更新,但正如您在问题中看到的那样,将 container-fluid 放入 container.

I'm not sure if the doc will be updated accordingly, but as you'll see in the issue it looks like it's ok to put a container-fluid inside a container.

这篇关于twitter bootstrap,容器类不可嵌套的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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