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
有没有测色盲的软件ipad可以用ps怎么下载软件畅言教学通软件应用培训6合1小狗卡读卡软件键盘报声软件下载有没有测色盲的软件adobe管理文件的软件畅言教学通软件应用培训中文调音软件韩语图片识别软件下载音速启动怎么制作软件包畅言教学通软件应用培训联想笔记本最好的系统下载软件音速启动怎么制作软件包win10应用软件用不了韩语图片识别软件下载艺术特效字幕制作软件有什么练五笔打字的软件下载有什么练五笔打字的软件下载处理成普通话的软件千月软件包有什么练五笔打字的软件下载中文调音软件有什么软件可以听打测试的平安金管家这款软件怎么样怎样下载psd版软件下载平安金管家这款软件怎么样有什么软件可以听打测试的处理成普通话的软件联想笔记本最好的系统下载软件初创的雷皇朝里妖物横行,刚刚建立的仙警局要面对各种妖魔鬼怪.....刘冰异世重生为地龙,信手翻天覆地破苍穹。天塌下来由高个子顶着,梦飞扬成了那个高个子,在别人羡慕的眼神中,梦飞扬心理却很苦恼。 遥望星空,那是破碎的星辰,目光看向下方满是破碎山河大地。已经是2678年,地球资源即将枯竭……在一个极度内卷的时代,今天又该如何生存是一半人每天都在思考的问题。大部分人沉迷在虚拟的世界中,等着生命一点一点的逝去……文中的“我”只是一个学生,却不甘现实的虚无,在这个被资本支配着的,麻木的社会,寻找着书中提到的“乌托邦”。 这个世上有鬼吗? 真的有,而且有很多。 我叫徐艺,在我十八岁那年,我猛然发现了这个世界的真相。 踏天地,燃道途。破生死,度轮回。血染四方,荒慑八面,我欲立天,动乾坤! 元气大陆,肉弱强食,唯有繁衍到巅峰的元气修行! 少年出自凯云镇,一切从这里开始......。石小方是个很方正死板的人,说了不能妥协就是不能,说了不能少泡一个就是不能,一直以自己所能想到的各种无耻借口做着方正而死板的自己。但是现在的他很方,他只是个打算如方石一般横扫过人生这个终将有终点的大滑坡,怎么突然就告诉他,这个滑坡之下,是修真界这片汪洋大海呢? 俗世百年,我的钱呢?我的妞呢?我的七情六欲,你一片海就要我全丢了,去做你的定海神石?想得美呢吧老头子们! 结束了吗? 从孤儿院出来在外漂泊十几年,却拒绝少年的请求离开了世界。 哈哈,不甘心, 如果上天再给我次机会, 我一定要好好活下去。 一个经典的穿越为开头的故事,有金手指,主角会遇到一些很基本的问题,慢慢或者快快去解决。生如蝼蚁,当有鸿鹄之志;命比纸薄,更有不屈之心。且看乡野小子叶安在受到仙道宗门欺负后,如何利用九天神玦一步步绝地反击,走上强者之路,最终成为擎天巨擘的故事。绚丽多姿的修仙世界、生动逼真的打斗场景、数之不尽的奇珍异宝、曲折离奇的故事情节足以让你心驰神往、欲罢不能。每个人心底都有一个修仙梦,每位读者都能在书中找到自己的影子。还等什么呢,让我们共同开启这修仙之旅吧。
逆天覆云传 无敌林飞扬 风火盐城 神算异世 克利西亚 今天又是在师门垫底的一天 分身大帝 谷情封夕 万灵寻道 大唐风雨录 危机末世:这次定要娶你 虚度三十年华 界碑,狸奴眼 末世起源之邪神传 你秀了我一脸 剑踏九洲 重生华夏:灵域归途 再世灵者 陨仙魔尊 江湖豪侠传 ps软件下载绿化版 智通软件横道图 艺术特效字幕制作软件 键盘报声软件下载 ps软件下载绿化版 团团影院软件下载 艺术特效字幕制作软件 相册涂鸦软件下载 怎样下载psd版软件下载 混凝土悬挑梁板承重计算软件 苹果手机助手什么软件好用的 苹果手机助手什么软件好用的 电脑股票软件出现乱码怎么解决 智通软件横道图 有没有测色盲的软件 键盘报声软件下载 畅言教学系统下载软件 怎样下载psd版软件下载 日语写字软件 畅言教学通软件应用培训 智通软件横道图 win10应用软件用不了 日语写字软件 音速启动怎么制作软件包 韩语图片识别软件下载 电脑股票软件出现乱码怎么解决 ps软件下载绿化版 ipad可以用ps怎么下载软件 日语写字软件 怎样下载psd版软件下载 键盘报声软件下载 2017社交软件下载量 6合1小狗卡读卡软件 有没有测色盲的软件 有什么软件可以听打测试的 平安金管家这款软件怎么样 6合1小狗卡读卡软件 艺术特效字幕制作软件 电脑股票软件出现乱码怎么解决 win10应用软件用不了 平安金管家这款软件怎么样 混凝土悬挑梁板承重计算软件 什么手机群视频软件好 畅言教学系统下载软件 音速启动怎么制作软件包 2017社交软件下载量 苹果手机助手什么软件好用的 平安金管家这款软件怎么样 电脑股票软件出现乱码怎么解决 adobe管理文件的软件 亚星游戏官网 亚星官网 亚星官网 亚星官网 亚星游戏官网 时空入侵 都市傲视狂兵 神眼赘婿 超平时空 不周树 AG真人 亚星管理平台 亚星游戏官网 AG真人 百家乐官网 什么手机群视频软件好 日语写字软件 韩语图片识别软件下载 照片文字识别韩文软件 有没有测色盲的软件 怎样下载psd版软件下载 ipad可以用ps怎么下载软件 键盘报声软件下载 ps软件下载绿化版 处理成普通话的软件 有什么练五笔打字的软件下载 什么手机群视频软件好 苹果手机助手什么软件好用的 畅言教学通软件应用培训 韩语图片识别软件下载 混凝土悬挑梁板承重计算软件 相册涂鸦软件下载 6合1小狗卡读卡软件 ipad可以用ps怎么下载软件 平安金管家这款软件怎么样 混凝土悬挑梁板承重计算软件 有什么练五笔打字的软件下载 平安金管家这款软件怎么样 畅言教学系统下载软件 键盘报声软件下载 2017社交软件下载量 艺术特效字幕制作软件 智通软件横道图 处理成普通话的软件 相册涂鸦软件下载