html - 容器内的元素不占满宽度

标签 html css twitter-bootstrap-3

我正在使用 Bootstrap 3 和 Css3 在 HTML5 中开发一个主题,每当我将任何元素放入容器中时,该元素都不会占据全宽,并且会在容器两侧留出大约 10 像素的边距.但是我想使用容器的全宽,我该怎么办??

最佳答案

Bootstrap 的文档指出容器是不可嵌套的。页面的主要部分应该只有 1 个容器。在该容器中,您可以使用 div 或其他 block 元素,而不会过度使用容器类。

Easily center a page's contents by wrapping its contents in a .container. Containers set width at various media query breakpoints to match our grid system.

Note that, due to padding and fixed widths, containers are not nestable by default.

http://getbootstrap.com/css/#overview-container

关于html - 容器内的元素不占满宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21429527/

相关文章:

html - 如何使用 Bootstrap 制作水平导航栏?

html - 为什么 CSS 中的 "margin: 0 auto"+ "display:block"命令是居中元素?

css - 为什么 Bootstrap 3 列宽不准确?

html - 在嵌入响应 Bootstrap 类中设置最大高度嵌入元素

javascript - 让人们从移动网站恢复到桌面网站

html - CSS HTML 下拉菜单不显示全文和文本未对齐

javascript - 每个卷轴都会带您到一个新的 div 以启用动画

CSS: @import: 为什么它必须排在第一位?

javascript - DIV 重叠。需要把它移过去,这样他们就不会

twitter-bootstrap - Bootstrap Collapse 无法正常工作(Hide Not working)