当前位置: 代码迷 >> Web前端 >> bootstrap 的格局
  详细解决方案

bootstrap 的格局

热度:952   发布时间:2013-01-01 14:04:18.0
bootstrap 的布局

bootstrap 的布局为12列布局,页面宽度为940px,


为什么940? 为什么居中


.container, { width: 940px; }

还有就是规定了这个container的页面居中

.container { margin-left: auto; margin-right: auto; *zoom: 1; }

清空后面元素

.container:before, .container:after { display: table; content: ""; } .container:after { clear: both; }


为什么里面还有个row

.row { margin-left: -20px; *zoom: 1; }


如下:

[class*="span"] { float: left; }


[class*="span"] { margin-left: 20px; }


同理就明白了 offset的class的意义了。

嵌套为同样的道理。