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
异界漫画大全医生体检调教漫画异界纵横之魔兽剑圣漫画异能校园类漫画异世界的女王大人漫画全集异界漫画大全一直喝酒漫画异界纵横之魔兽剑圣漫画医的漫画隐形人全彩漫画异世界皇妃漫画免异界纵横之魔兽剑圣漫画一之封印火影同人漫画异世界皇妃漫画免异能恋爱类漫画隐形人全彩漫画一只猫的一生 漫画异世界的女王漫画全集异世界的女王大人漫画全集椅子上自慰漫画图片大全医生漫画版异世界的女王漫画全集医的漫画椅子上自慰漫画异世界的女王大人漫画医院萝莉漫画异世界的女王大人漫画椅子上自慰漫画椅子上自慰漫画图片大全一之封印火影同人漫画本书为双主人公象棋新世纪天才王中帅18岁意识穿越空间竟然变成一枚棋子红老帅! 王中帅:虽然本天才很红很帅但我一点也不老啊! 另一位主人公却是山村12岁喜欢下棋的小孩顾斌,聪明谈不上,却有点少年老成。 两位主人公一大一小,性格却一个活泼开朗,一个沉稳内敛,他们将碰撞出怎样的火花? 王中帅的那个她是谁?红颜知己还是单恋一枝花?还有没有机会重逢? 老神仙就漏了一面驾鹤西游了? 他是道光年间的棋手顾先生吗? 他与顾斌,小山村有何渊源? 预知详情敬请关注,2021黑与红!他高傲,但是宅心仁厚。 他低调,但是万人敬仰。 他是天启皇帝的好朋友,亿万人的心中偶像。 他的宗旨是创建和谐新大明。 一段爱恨情仇,一代精神领袖,横跨三界,携美女畅游九州,奋战疆场,金戈铁马,策马奔腾,穿越万里河山,与夏王开华夏一统,与褒姒调丝竹之情,领勇士救刘邦,出入汉宫,霓裳羽衣,再现华夏文明,助太宗杀兄泡嫂,与李治共享武媚,环肥燕瘦,皆出其手,他,是英雄、是败类、是奸雄、还是淫贼,上下五千年,皆无定数,一切皆有后人评说……现实社会中我唯唯诺诺 重生之后看我重拳出击 开商铺,练武道,从此我成为了大齐帝国最出名的商业巨鳄....一个强盛的王朝,在烈焰中轰然倒塌。覆巢之下,人们挣扎在未尽的余灰中。许多人扛起了复国的渴望。可是,汹汹而来的鬼蜮伎俩,却将乱局搅动得愈加波诡云谲。好在,大智大勇者的神机妙算,最终冲破了鬼魅的阴霾。然而,一桩被掩藏了数十年的王朝秘事,却始终裹挟在迷雾之中,如今,它更是幻化成一张正缓缓地张开的血盆大口,誓要将这破碎的王朝一口吞下。性格孤僻的天才警官南港市公安局东海分局局长北海琼月只有一个愿望——成为一名恪尽职守、秉公执法的优秀警察。她从不怀疑自己的能力,坚信自己能做到让每一起案件水落石出,不料南港市发生的一系列连续凶杀案让一向被誉为神探的北海琼月焦头烂额,被害者不仅毫无共同点,而且死因离奇。北海琼月身为专案组长一直希望尽快破案,不料一件又一件事情打乱了她的计划…… 正在北海琼月被一个个意外弄得焦头烂额的时候,案件出现了一丝转机,有人目击到凶手犯案的过程,甚至在案发现场活捉凶手。本该为此举杯庆祝的北海琼月却陷入了沉思,这个被逮捕的凶手不是别人,正是和她一起上学、一起工作、一起办案的她唯一的朋友。 友情的信任遭到了巨大的冲击。作为警察,北海琼月有义务履行职责;但作为朋友,北海琼月不相信她是凶手。信任和证据面前,北海琼月必须做出抉择。 绝对控制的力量……时间。 罗克死后,当一块三角形的岩石与他的灵魂融为一体时,他神秘地重生在了舜龙几近死去的身体里,顿时一股信息涌入了他的脑海。 他现在发现自己置身于一个神秘的世界,这里到处都是拳毁高山,剑劈大海的异常强大的修真者! 这就是舜龙在修真界的磅礴征程,他与天才斗智斗勇,成就炼丹与武道的巅峰!从小秦悦就知道自己是鬼生下的孩子,是不吉利的,后来村里的祭祀在身上烙了一个印,可惜,这个印不仅没用,还惹来了很久以前的诅咒... 苦修十余年,却被告知自己有个富家千金的未婚妻?杨祁下山,却没想反遭对方长辈轮番羞辱!   男儿志气尚在,杨祁果断打脸对方,并且提出退婚!   然而,退婚一事不成,杨祁却卷入了江渝的风波之中,在风波之内以逆天医术,超凡武学打拼出一片天地!堂屋正中的灵牌贴上自己的照片,荒村后山的墓碑刻上自己的名字,卧室房灯挂上晃动的麻绳,自来水管里面塞上带着头皮的头发....   去住个凶宅,挖个坟,抱个纸人,撞个鬼,作为有一个上进心的恐怖片龙套,这不都是应该做的吗?
雁北 纯丶真 奴役全人类 天元灭魔传 综武:我在大宋当皇子 李相穿越记 阴差救父 塞罕坝:开局就是王炸 末世之吞噬细胞 星辰神祗 果宝特攻之时空穿越 弄哭同桌后,我天下无敌! 分身大帝 宗主真乃神人也 秦武风云起 雄威!大唐无双 京城:修成神话 诸天战场:我能无限加点 守望:光与暗的对决 一统异世 医院和护士女主角漫画图片大全 异世界式的教育者漫画7 一只猫的一生 漫画 异世界的女王大人漫画全集 医院和护士女主角漫画图片大全 以完结漫画 推荐 一只猫的一生 漫画 一心二体是什么漫画 医院萝莉漫画 一兴奋就会失禁漫画 一组漫画 糖给你花给你 一组漫画 糖给你花给你 椅子上自慰漫画图片 异世界式的教育者漫画7 异界漫画大全 异世界的女王大人漫画全集 一周更新漫画 医院和护士女主角漫画图片大全 医生漫画图片男 异界纵横之魔兽剑圣漫画 异世界式的教育者漫画7 异界纵横之魔兽剑圣漫画 医生漫画图片男 异世界的女王漫画全集 隐形人全彩漫画 椅子上自慰漫画图片 医院和护士女主角漫画图片大全 医生体检调教漫画 医生漫画图片男 医院萝莉漫画 异世界的女王大人漫画全集 异世界女王漫画全集 异能校园类漫画 异界漫画大全 椅子上自慰漫画 异世界的女王大人漫画 异能校园类漫画 一只猫的一生 漫画 椅子上自慰漫画 异能恋爱类漫画 异世界的女王大人漫画 一心二体是什么漫画 椅子上自慰漫画图片大全图片 一周更新漫画 异世界皇妃漫画免 异世界女王漫画全集 一组漫画 糖给你花给你 异世界的女王大人漫画 椅子上自慰漫画图片 一只狗当作人的漫画 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 我的倾城大小姐 大唐之神级败家子 奥特胶囊系统 新宿风云 这个世界不正经 快连下载 亚星管理平台 亚星官网 快连下载 亚星管理平台 医生漫画版 椅子上自慰漫画图片大全图片 异能恋爱类漫画 异界纵横之魔兽剑圣漫画 医院和护士女主角漫画图片大全 一心二体是什么漫画 一只狗当作人的漫画 医院萝莉漫画 以完结漫画 推荐 医院萝莉漫画 异世界皇妃漫画免 以完结漫画 推荐 椅子上自慰漫画图片大全 椅子上自慰漫画图片大全 医生漫画图片男 一组漫画 糖给你花给你 异界纵横之魔兽剑圣漫画 隐形人全彩漫画 一兴奋就会失禁漫画 一心二体是什么漫画 异能校园类漫画 医生体检调教漫画 椅子上自慰漫画 异世界的女王大人漫画 医院和护士女主角漫画图片大全 医生体检调教漫画 异世界的女王大人漫画全集 医院和护士女主角漫画图片大全 椅子上自慰漫画 异世界的女王大人漫画