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
末日小说 不要变态的琴箕 龙戬同人小说小说玄幻第章少女长裙湿你坏天下唯双同人小说凤穿牡丹原剧小说暗黑2 同人小说类似 男神是个狐狸精 小说小说玄幻第章少女长裙湿你坏女扮男装的小说 文笔好娇妻如云 军事小说毒舌校草接招吧+双木日+小说末日小说 不要变态的小说 赵国女人 被轮 小说小说玄幻第章少女长裙湿你坏娇妻如云 军事小说和师姐在一起 小说高跟鞋 小说高跟鞋 小说2011年中国微型小说精选 下载掀开职业套裙 小说高跟鞋 小说女扮男装的小说 文笔好58免费全本小说 - 百度凤穿牡丹原剧小说凤女倾城+吟倾月+小说天下唯双同人小说熊熊小说鹏程万里丑闻 小说小说 赵国一代魔君萧逸枫被迫重生回到过去, 开局喜提战力天花板老婆,我于人间已无敌? 屁!当他说出,仙子,我真是你夫君时,堂堂一代魔君差点没被妻子掐死。 他发誓要重新征服这冷艳美人! 他腹黑,不舔狗,人狠话又多,为达目的不择手段。 对朋友他是完美的化身,对敌人他比魔教还魔教! 一人分饰两角,将幕后黑手的活全抢了! 表面上他是正道天才,背地里他化身魔教新秀搅动天下风云。【未来世界+赛博朋克+武道崛起】 数十年前,地球轨道之上有一轮赤星高悬,全新的时代开启了! 在未来,没有和平,地面被异族霸占,人类生活地下!这里没有暖阳、大海、天空、森林,有的只是四周漆黑的土壁。 然而在五颜六色的霓虹灯下、冰冷的机械铁甲下,仍是潜藏黑暗,它无处不在。 终有一日,闯出一群有志之士,他们身披战甲,意气风发,带领人类拨开地表,撕破黑暗,前方是光! ………………结社联盟,络网聚伙,号曰荡吧,颇成规模。中有孙者悟空,传闻乃为辽东人氏,及以草创之际沥血呕心,不为其功,熟料事业将成,卓然为粪首佛头,蛊惑盲流,立为一叚,东引祸水,西惹它言,今番已为群盗者之首也。我等众人,勠力同心,歃血而誓,诛此内贼,清平寰宇。余之有幸,得以著笔,跋序檄文,列书荟萃,集万千同袍之心,汇集新著,笔墨为矢,文言为锋,以此起兵,共讨瑕玊之蜮,故名为《讨孙平叛传》大魏王朝,妖魔乱世,幽鬼横行。 当顾青玉睁开眼睛醒来之后却发现自己只有七日可活! 无奈之下,只好凭借驯养系统驯养一只青龟,将其化作自己的一个分身! 【叮!是否消耗成长点驯养青龟?】 【驯养成功!】 【青龟等级提升!】 …… 【叮!是否消耗进化点进化天元青龟?】 【进化成功!】 【天元青龟进化成为:天元龟!】 【叮!获得能力‘天元一气’!】 …… 顾青玉发现,自己驯养的分身不但可以不断升级,还可以不断的进化…… 一块废铁竟是上古神明的遗物?八大神系不仅仅是传说?博物馆中的藏品竟是力量来源。在这个神迹时代,孙兴拥有了整个大陆藏品最为丰富的博物馆,诸神随之调动,人治时代从此开启!安云凡身份成谜,师承玉青子,成为道门第一天师,一路斩妖除魔维护人间,在历劫后知道自己真实身份的他将会如何选择?是继续秉承自己的道心还是?一个喜欢吃凉面的男孩却意外穿越到异世界,却凭借着凉面扬名整个世界,是命运的安排,还是执棋人的棋子……亦木墟历练归来时见到家族覆灭,发誓欲要血刃仇敌,报其家恨。 闯秘境,夺至宝,守边疆,战万族。 沧海一粟,修行千秋,蝼蚁尚且贪命,诸天生灵皆在争渡。 一颗黑球可炸山镇海,一杆长枪可斩万千神明。 是非对错唯有强者定义,弱者只配臣服。 武道九重,上为天地境。 当末法时代结束,修行元气重归上古。 整个修士界,皆因亦木墟的一颗轰天雷,即将暴走...李戬穿越到了大虞王朝成了世子殿下,本想快活一生,却见皇帝昏庸,奸臣当道,一怒之下,诛奸佞!戮小人!挟天子以令诸侯!拳打蛮夷,脚踢倭寇!反手能镇八荒!覆手可定六合!*****《流浪在仙界》的有声图书已经在喜马拉雅上架了,多谢各位多去关注。*****百里长青穿越到仙界后发现:地球的心法远不如仙界的功法,但地球的武技却远高于仙界的武技。 汉武帝以:“侠者,以武犯禁”为借口,将江湖上的大部分武林高手围剿斩杀。百里长青(原名郭解)和他的八个兄弟,四个婢女,七个徒弟,还有五千个生死兄弟,在卫青大将军的十万大军合围后,全部万箭射杀,最后被仙界大佬救下灵魂穿越到仙界的凡人界,要求他们去仙界完成一个非常重要的任务。 百里长青带着他的兄弟和徒弟在仙界杀进凡人界,仙人界,神界等一个又一个的大陆,破解一个又一个的惊天阴谋,最终尘埃落定! 三世为人,穿越到仙界后百里长青一切看淡,性格大变,游戏风尘,风趣幽默尽在本书中。
觉界:双子位面 海贼之无敌后才开始签到 春秋战国历史演义 活着是为了什么? 剑指云水间 娘胎签到:全世界都在阻止我出生 亡灵之友 雪史功业 虚无之诸世界 太平逝 界主往事 入赘后,娘子对我太好怎么 王之起点 俏无常 王途末路 迷雾中的顾温柔 科研大佬从相亲走错桌开始 我的老头儿老太儿 平凡,平安,还是平天下 浩劫余生 小说军官编 男友 吃 精液 小说 和师姐在一起 小说 高跟鞋 小说 小说军官编 小说 春药 求我 给你 好看的穿越小说男主的 皇上 我不是女主小说 凤女倾城+吟倾月+小说 小说 赵国 女扮男装的小说 文笔好 花都贴身高手 千千小说 58免费全本小说 - 百度 娇妻如云 军事小说 暗黑2 同人小说 凤穿牡丹原剧小说 好看的穿越小说男主的 凤女倾城+吟倾月+小说 掀开职业套裙 小说 末日小说 不要变态的 男友 吃 精液 小说 小说玄幻第章少女长裙湿你坏 琴箕 龙戬同人小说 女人 被轮 小说 娇妻如云 军事小说 58免费全本小说 - 百度 凤女倾城+吟倾月+小说 琴箕 龙戬同人小说 掀开职业套裙 小说 凤女倾城+吟倾月+小说 凤穿牡丹原剧小说 男友 吃 精液 小说 唐家三少 的黄色小说 末日小说 不要变态的 熊熊小说鹏程万里 凤穿牡丹原剧小说 唐家三少 的黄色小说 和师姐在一起 小说 58免费全本小说 - 百度 唐家三少 的黄色小说 凤穿牡丹原剧小说 替换 皇帝 小说 2011年中国微型小说精选 下载 花都贴身高手 千千小说 女人 被轮 小说 男友 吃 精液 小说 花都贴身高手 千千小说 天下唯双同人小说 丑闻 小说 类似 男神是个狐狸精 小说 亚星官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 道天之上 登天仙途 一剑惊九州 一只骷髅的科研进化路 晴姐,等我的江山如画 亚星管理平台 葡京官网 AG真人 亚星管理平台 万利官网 高跟鞋 小说 小说 赵国 高跟鞋 小说 唐家三少 的黄色小说 毒舌校草接招吧+双木日+小说 小说 春药 求我 给你 丑闻 小说 58免费全本小说 - 百度 皇上 我不是女主小说 女人 被轮 小说 皇上 我不是女主小说 曲樱小说 掀开职业套裙 小说 皇上 我不是女主小说 唐家三少 的黄色小说 掀开职业套裙 小说 凤女倾城+吟倾月+小说 小说军官编 和师姐在一起 小说 云枫幽幽寒镜小说未完结 熊熊小说鹏程万里 高跟鞋 小说 毒舌校草接招吧+双木日+小说 女人 被轮 小说 2011年中国微型小说精选 下载 花都贴身高手 千千小说 琴箕 龙戬同人小说 暗黑2 同人小说 小说玄幻第章少女长裙湿你坏 暗黑2 同人小说