1
1
1
1
1
1
1
1
1
1
1
1
4
4
4
4
8
6
6
12

The default grid system provided as part of Bootstrap is a 940px-wide, 12-column grid.

It also has four responsive variations for various devices and resolutions: phone, tablet portrait, table landscape and small desktops, and large widescreen desktops.

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

As shown here, a basic layout can be created with two "columns," each spanning a number of the 12 foundational columns we defined as part of our grid system.


Offsetting columns

4
4 offset 4
3 offset 3
3 offset 3
8 offset 4
<div class="row">
  <div class="span4">...</div>
  <div class="span4 offset4">...</div>
</div>

Nesting columns

With the static (non-fluid) grid system in Bootstrap, nesting is easy. To nest your content, just add a new .row and set of .span* columns within an existing .span* column.

Example

Nested rows should include a set of columns that add up to the number of columns of it's parent. For example, two nested .span3 columns should be placed within a .span6.

Level 1 of column
Level 2
Level 2
<div class="row">
  <div class="span12">
    Level 1 of column
    <div class="row">
      <div class="span6">Level 2</div>
      <div class="span6">Level 2</div>
    </div>
  </div>
</div>

Fluid columns

1
1
1
1
1
1
1
1
1
1
1
1
4
4
4
4
8
6
6
12

Percents, not pixels

The fluid grid system uses percents for column widths instead of fixed pixels. It also has the same responsive variations as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.

Fluid rows

Make any row fluid simply by changing .row to .row-fluid. The columns stay the exact same, making it super straightforward to flip between fixed and fluid layouts.

Markup

<div class="row-fluid">
  <div class="span4">...</div>
  <div class="span8">...</div>
</div>

Fluid nesting

Nesting with fluid grids is a bit different: the number of nested columns doesn't need to match the parent. Instead, your columns are reset at each level because each row takes up 100% of the parent column.

Fluid 12
Fluid 6
Fluid 6
<div class="row-fluid">
  <div class="span12">
    Level 1 of column
    <div class="row-fluid">
      <div class="span6">Level 2</div>
      <div class="span6">Level 2</div>
    </div>
  </div>
</div>
Variable Default value Description
@gridColumns 12 Number of columns
@gridColumnWidth 60px Width of each column
@gridGutterWidth 20px Negative space between columns
@siteWidth Computed sum of all columns and gutters Counts number of columns and gutters to set width of the .container-fixed() mixin

Variables in LESS

Built into Bootstrap are a handful of variables for customizing the default 940px grid system, documented above. All variables for the grid are stored in variables.less.

How to customize

Modifying the grid means changing the three @grid* variables and recompiling Bootstrap. Change the grid variables in variables.less and use one of the four ways documented to recompile. If you're adding more columns, be sure to add the CSS for those in grid.less.

Staying responsive

Customization of the grid only works at the default level, the 940px grid. To maintain the responsive aspects of Bootstrap, you'll also have to customize the grids in responsive.less.

Fixed layout

The default and simple 940px-wide, centered layout for just about any website or page provided by a single <div class="container">.

<body>
  <div class="container">
    ...
  </div>
</body>

Fluid layout

<div class="container-fluid"> gives flexible page structure, min- and max-widths, and a left-hand sidebar. It's great for apps and docs.

<div class="container-fluid">
  <div class="row-fluid">
    <div class="span2">
      <!--Sidebar content-->
    </div>
    <div class="span10">
      <!--Body content-->
    </div>
  </div>
</div>

Responsive devices

What they do

Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

  • Modify the width of column in our grid
  • Stack elements instead of float wherever necessary
  • Resize headings and text to be more appropriate for devices

Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.

Supported devices

Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:

Label Layout width Column width Gutter width
Smartphones 480px and below Fluid columns, no fixed widths
Smartphones to tablets 767px and below Fluid columns, no fixed widths
Portrait tablets 768px and above 42px 20px
Default 980px and up 60px 20px
Large display 1200px and up 70px 30px

Requires meta tag

To ensure devices display responsive pages properly, include the viewport meta tag.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Using the media queries

Bootstrap doesn't automatically include these media queries, but understanding and adding them is very easy and requires minimal setup. You have a few options for including the responsive features of Bootstrap:

  1. Use the compiled responsive version, bootstrap-responsive.css
  2. Add @import "responsive.less" and recompile Bootstrap
  3. Modify and recompile responsive.less as a separate file

Why not just include it? Truth be told, not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it.

// Landscape phones and down
@media (max-width: 480px) { ... }
// Landscape phone to portrait tablet
@media (max-width: 768px) { ... }
// Portrait tablet to landscape and desktop
@media (min-width: 768px) and (max-width: 980px) { ... }
// Large desktop
@media (min-width: 1200px) { .. }

Responsive utility classes

What are they

For faster mobile-friendly development, use these basic utility classes for showing and hidding content by device.

When to use

Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.

For example, you might show a <select> element for nav on mobile layouts, but not on tablets or desktops.

Support classes

Shown here is a table of the classes we support and their effect on a given media query layout (labeled by device). They can be found in responsive.less.

Class Phones 480px and below Tablets 767px and below Desktops 768px and above
.visible-phone Visible
.visible-tablet Visible
.visible-desktop Visible
.hidden-phone Visible Visible
.hidden-tablet Visible Visible
.hidden-desktop Visible Visible

Test case

Resize your browser or load on different devices to test the above clases.

Visible on...

  • Phone✔ Phone
  • Tablet✔ Tablet
  • Desktop✔ Desktop

Hidden on...

  • Phone✔ Phone
  • Tablet✔ Tablet
  • Desktop✔ Desktop
香港回归纪念邮票南京文交所钱币邮票交易中心龙邮票奥运邮票邮票邮票吧邮票市场上海邮票网邮票吧民居邮票所谓神明,不过是蛰伏在暗影之处的小偷! 他们需要称颂,他们需要信仰,他们需要祭祀,他们需要血肉。 他们自称给予你所想要的一切,在你耳边低声呓语!本文讲述的是一个不受控的智械, 如果诞生在人类世界中,到底会引发怎样的一系列的事情 它会自我学习,也会进化,最终会成长到怎样的地步。一拳可开辟天地,一气可灭三千袁宇,就是这么一个强大而可怕的存在,却也逃不过七情六欲的熏染,反而活的越来越像个人了。赵阳意外绑定可以往返现代与明末的传送门。 穿过传送门,对面是气势汹汹,向着他冲刺而来的八旗骑兵。 数次尝试都铩羽而归,赵阳直接上交传送门,与官方合作。 当官方看到赵阳展示的另一个世界后,整个大夏都为之轰动。 一个星球的资源,一个全新的未开发世界! 大夏官方第一时间下定决心,制定绝密计划,设置最高权限。 终于,再次踏入明末大地的赵阳。 身后,是一条蓄势待发的庞然巨龙……世界遭到入侵,最强武道大帝力战而亡,重生在九千年后的世界,成了酒馆的店小二,并觉醒了全能系统。 通过系统,张易能够看穿世间功法、丹方和对手的缺陷。 为了抵抗即将而来的乱世,张易再次踏上修炼之路。 在他破格的实力下,对他心怀敬畏的人、闻名而至的人、求爱的人络绎不绝。 然而,就在他步步建造势力之时,那过去让世界陷入恐怖的危险,又开始在暗地里行动了……余跃从2022年穿越会了玛雅文明时代,发现这居然是个可以修炼成神的时代……开局收到一座城,剩下全靠自己装。 帅哥美女小老头,萝莉萌宠大坏蛋。 这是一个卡在深空的男人,准备干翻一个种族的故事。 这是地球联通多元宇宙后,现代科技与古代玄幻的碰撞。 这是一群奇葩损友,抗击深空的传奇一生。 这可能是一场注定了没有胜负的棋局… 一城两星三世人,几转轮回道苍生。   “左眼为阴,右眼为阳,日夜更替,阴阳轮换,俱在我身”   浩瀚的宇宙边陲之地,只有无光无明的漆黑。   有一个男子正盘腿悬坐在星空中,而伴随刚才的话语,他的眼睛突然从眼眶里跳了出来,只留下两个空洞的眼眶,   此时这两只眼睛都还覆盖着眼皮,闭着眼睛。   忽然,一只眼睛睁开。   漆黑的星空便有了光明,十分耀眼,光芒照在男子和他前面的一具尸体上。   这时,才发觉这男子和这具尸体竟散发这仙人之气。   男子是这方世界两大仙帝之一的——陆仙帝,而他面前的尸体则是另外一个仙帝——陈仙帝。   两位仙帝大战于此,落得两败俱伤。   陆仙帝左手之上托着一个灵魂,恰是一个女子的模样,不过已经没有了多少灵性,陆仙帝叹了了口气,道:   “便只能转世重生了”   而陆仙帝刚才将自己的灵魂打入这三千世界,转世重生,夺取生机。   灵魂纷纷降落重生,化作小世界中的土著,其中便有一份灵魂便将落在这一方世界——蜉蝣界。   故事就此开始,少年李耀,被家族迫害,机缘巧合获得一剑。此剑木质且无名,看似平凡,实乃不凡。谁知此剑,乃久远的缘。从此少年一路崛起,持剑杀遍挡路者,开启慢慢剑修路!无敌之日,为民谋福,乐在其中,浪迹天涯!末世小人物,系统觉醒搜魂,抬手间抽取变异体技能,我虽废柴,却日益强大…… 看他如何在充满变异体的异世界闯出自己的一片天地……
邮票网 纪念邮票 猴年邮票 十二生肖邮票 生肖邮票 民居邮票 文革邮票 邮票互动网 女幽灵 百度网盘下载 迅雷下载 邮票价格 邮票价格 邮票行情 鸡年邮票 邮票图片 上海邮票网 邮票价格 上海邮票网 上海邮票网 邮票市场 大龙邮票 中国邮票 中国邮票价格表 邮票行情 南京文交所钱币邮票交易中心 南京文交所钱币邮票交易中心 香港回归纪念邮票 邮票网 邮票价格 生肖邮票 文革邮票 世界上第一枚邮票 纪念邮票 邮票收藏价格表 第三轮生肖邮票 女幽灵 百度网盘下载 迅雷下载 生肖邮票 邮票市场 香港回归纪念邮票 第三轮生肖邮票 香港回归纪念邮票 断肠刺死亡推理之追狱人俺是一个保安生活在月球春秋战国吧一代潜龙你听过吗?天地灵气决开局入住凶宅云梦生我于当世立绝资完美佳婿之我真不是股神玄幻:我能捡属性变强潜龙帝帅小神山里有一位仙家踏仙行纪走错厕所被女教授给揍了转生为哈士奇时间空气是什么,我不在意人在末世,打造虫族大军深圳办公家具公司请复制到浏览器打开 台州卫浴柜 怎样做水波帘头 安尔雅清晰韩式衣柜门板 水晶的价格 晋中印象城房价 多功能沙发 英伦 家具 卡撒浴室柜 太阳能空调价格 藤艺家具 水波纹帘头图片 常州市光华路房价 普宁 衣柜 买 沙发 好 还是 定做 的 好 ? 自制木衣柜 懒人沙发 家居 嘉善路169弄 世家小区 沌口搬家公司电话 箭牌马桶怎么样 蝴蝶水波帘头的制作方法 衣柜杆子 大众搬家电话号码 12门abs全塑更衣柜 重叠式水波帘头图片 郑州69号院二手房价 包店货架 干货架结构 广州 二手房 深圳中型货架 艾美特货架 地垫价格 浴室柜出口工厂 家用吸尘器价格 卫浴水箱厂 鼎格卫浴 大西洋新城房价 沙发布厂家 水波帘怎么样的 衣柜颜色 百叶窗帘价格 旧马桶处理 盛唐国际二手房价雄县 板条 衣柜 面漆门厂家 旧宫搬家公司 重庆窗帘 品牌衣柜 担心房价下跌遭批 衣柜修理 卫浴柜 杭州未来广场房价最新消息 手绘墙画价格 仓库高位平台 小区论坛 江西家具 中国货架厂 芜湖沙发厂家 河源货架厂 意大利m d沙发 楼房窗帘 上海江桥二村二手房价格 动化仓库 横向水波怎么裁剪 上海家具展览会 窗帘水波幔头制作 家用家具 丽园路488弄房价 水波幔的计算方法 衣柜效果图大全2013图片 整体衣柜 90度衣柜 沈阳自动门厂家 屏风价格 成都衣柜定制 鹅卵石价格 小孩衣柜 芜湖小区 窗帘的品牌 大衣柜开门 餐厅家具 厕纸和马桶 佛山松木 沙发 订制浴室柜 濮阳小区 仓库超市 太仓卫浴店 爵能马桶 窗帘空心水波的一裁剪 窗帘动力 昆明二手房出售 浴室柜 功能 北京房价走势2012 成都 百得胜衣柜 仓库位置规划 武汉 房价 好菜客衣柜 明月港湾房价 美隆马桶盖 青岛蚂蚁搬家公司招聘 河南办公家具 风格家衣柜 窗帘水波幔效果图