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
十二生肖邮票邮票价格邮票市场世界上第一枚邮票女幽灵 百度网盘下载 迅雷下载邮票收藏文革邮票世界上第一枚邮票邮票市场大龙邮票天生早衰体的绝世术师,地宗传人,为续命而寻找昆仑龙脉,恰逢古尸妖变,为全天地正道,接地脉龙气斩妖。 ”没吃饭吗?不想死就给老子快点。“ 噗,黑暗的大寒矿洞中,瘦骨嶙峋的王长安及族人正双眼失神,麻木的被压迫着。 是揭竿而起? 举族祭祀,掩埋于地下的青铜图腾,消逝的远古,揭示着血淋淋的真相.......“恭喜您,使用至尊版万界娃娃机抓取[狠人大帝的肚兜]一条。” “恭喜您,使用至尊版万界娃娃机抓取[萧炎的休书]一封。” “恭喜您,使用至尊版万界娃娃机抓取[地球出产的正宗假中华]一条。 ” 叶风华站在这大千世间的绝顶巅峰,忧郁地仰望星空,叹息道:“装逼非我意,但愿海波平”不知哪个无良老祖立的狗屁祖训,要夺魁才能入世,老子是全能好不?上知天文,下晓地理,琴棋书画样样精通!要不是这几年,看不了师妹们楚楚可怜的目光。会老屈居第二?一尤其那几个老不死的,要不是以后可能成为本少的老丈人,就凭你们老笑我半吊子,不打得你们半身不遂,我配姓隆?!今年比的是武功和医术,看谁能与我争锋?今年我一定要下山,大师姐都下山六年了,要是我找到她,她牵几个小屁孩叫我舅舅,那我找谁哭去?神祇时代,人人皆为神明,体内创立神国,高举神火,万族繁衍。 就在神明们还在争论到底是半兽人厉害,还是亡灵系大军恐怖的时候。 林凡看着自己的十万个钻在草丛里的大盖伦,无敌寂寞。 “我真的不是最强天神。” “我只是一个普普通通的LOL玩家而已。” 一众神明痛哭流涕:“大佬你说的都对,能不能先让那群莫甘娜把我们放开?我们真不认识凯尔!” “伟大的神王,快把那个爆破鬼才收回去吧,它往我的神域里扔了个东风快递!” “天啊,三万个死亡歌颂者的死亡合唱团又在唱歌了!” 人是人,仙是仙,人若想为仙,难比登天。天下凡人千百万万,得道成仙者百千年不得闻。 凡人非大机缘者,莫寻修仙路。然,何为机缘,机缘何得。 争,是智慧;不争,亦是智慧。 修仙修仙,修的是什么,修的不就是心么。三年前,剑宗第一天才叶雄为了承诺,隐瞒身份入赘到落魄王朝林家。 三年后,林王驾崩,林萱继位,世界暗潮涌动。魔族蠢蠢欲动,各方势力开始扩张版图,林家岌岌可危。 叶雄手持天罚,夺城池,杀魔物,战万兽,“林萱,我会为你斩在一条女帝之路。” 众人皆知花若芬芳,蝴蝶自来。可是,蝴蝶不来,花照样芬芳。本想我行我素,独自芬芳,却不想被卷入乱世“虫”流。 乱世之中谁是敌?谁又是友?该如何应敌?又该如何对友?一切问题,皆是答案。对付敌人最好的方法就是把敌人变成朋友。三千年之约,这是人类的承诺。 一颗只有自转没有公转的星球,一群身怀赤子之心的少年,一场跨越三千年的约定,一个改变人类存亡的决定,一代少年人的努力拼搏!命运背后的博弈,究竟孰强孰弱?且看我慕凡如何行于宇宙之巅一开始,穿成假太监的李易只想安分苟活着,但后来,看着高贵雍容的皇后,李易心思变了。 “江山你坐着,皇后我替你照顾。” 李易都跟皇帝打好了商量,奈何那把椅子,皇帝就是坐不稳啊! 前有狼,后有虎,奸臣又一堆堆,眼看国不国,家不家的,李易操起了屠刀……寻仙之路,漫漫无穷,那一缕剑气贯穿了天上地下,可叹! 才明了,凡仙之别,已成断路!神圣再现,风云再起,旧时代未葬下的魔,就由我来终结。(作者是个小白,文笔不好!)
世界上第一枚邮票 十二生肖邮票 邮票价格 文革邮票 上海邮票网 十二生肖邮票 邮票收藏 民居邮票 邮票价格 民居邮票 邮票图片 邮票收藏 香港回归纪念邮票 大龙邮票 邮票图片 奥运邮票 第三轮生肖邮票 十二生肖邮票 中国邮票价格表 邮票价格 邮票市场 鸡年邮票 猴年邮票 上海邮票网 邮票市场 邮票互动网 第三轮生肖邮票 邮票 纪念邮票 文革邮票 世界上第一枚邮票 奥运邮票 猴年邮票 大龙邮票 第三轮生肖邮票 邮票互动网 民居邮票 邮票行情 上海邮票网 邮票互动网 歧途:葬欢大明:家父永乐,永镇山河逃避世俗带着小丽回宋朝巨变的世界我有一只战斗鸡觉醒新纪元这个江湖归我们做主娱乐超级奶爸统宇之主灵异:开局签到神鬼七杀令大荒文明战记迦贡纪元以无为名预案亮剑它歪楼万古第一灵帝赛博朋克的最强跟班黑暗之中的光芒综漫之我是话痨系统万界正邪亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星游戏官网 亚星游戏官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 亚星官网 亚星游戏官网 亚星官网 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 【薇-電13228888433】皇冠登3出租 【薇-電1322 8888 433】皇冠登3出租 皇冠登3出租 薇-電 132-②⑧⑧⑧-8433 快连VPN - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快链下载 - 上海曲德曲网络科技有限公司 快连官网 - 上海曲德曲网络科技有限公司 快链加速器 - 上海曲德曲网络科技有限公司 快链加速器 - 上海曲德曲网络科技有限公司 快连VPN - 上海曲德曲网络科技有限公司