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
韩国漫画玩火在线观看平胸漫画图片韩国无码漫画在线观看视频火影忍者博人传漫画乾耽美漫画小猫韩国漫画玩火在线观看黑道漫画大全免费下载韩国无码漫画在线观看视频里番抖s漫画六道的恶女们漫画33漫画一护最后的虚化韩国漫画玩火在线观看爱爱高清漫画漫画一护最后的虚化韩国无码漫画在线观看视频六道的恶女们漫画33绝对恋爱命令漫画75耽美漫画小猫耽美漫画小猫粗点心战争漫画和动漫sm漫画耽美花漫画。 手感一个人漫画剪头发图片信乃长大漫画虫子钻美女下体漫画在线王者天下漫画531火影忍者博人传漫画乾和宠物做的漫画粗点心战争漫画和动漫白马x平次漫画我们登上并非我们所选择的舞台,演出并非我们所演出的剧本。猎人与猎物的身份发生了变换,原有的社会体系遭受冲击。世界不复太平,战争变得随处可见。 “我只想活下去,让身边的人活得好一点。”林奕由衷祈愿。在这异能者至上的时代,在这神秘充斥的时代,何者生存三年前,他破产落败,从天堂跌落地狱,尝遍了人情冷漠,白眼奚落,谩骂针对。 三年后,他携一身本领强势回归! 他是神医,也是杀神!不论你是想活命,还是想见阎王,都一个一个来!【灵异、悬疑、惊悚、探险、宠物、系统、游戏、搞笑】 废弃的别墅,消失的山村,黑暗的血楼…… 人头蜘蛛,红衣厉鬼,浑身是手的怪物…… 在这个深夜的恐怖世界里,王尊稳如老狗,遇人先问娘,杀鬼必扬灰,万事只求一个安稳! 别人还恐惧在诡异怪谈中时,王尊在惊悚游戏世界里杀疯了。天武大陆,宗门林立,武道昌盛,丹道却毫无起色,于是就有了一个人,一群朋友,开辟丹道,逆武巅峰的故事。诡异前世之旅,只因那一世有未了之恩怨情仇!乌王轮回数千年,历几经沧海桑田,斗转星移,为何容颜不改?都说一朝轮回,忘却前尘,乌梦楼却为何深藏前世记忆?一部《莫问前世我是谁》带你进入乌魂诡界,破译乌魂千年之迷?股市,是上帝留存在世间的最后一个伊甸园。 这个伊甸园,是圣人的天堂,凡人的地狱。 不管是圣人又或者是凡人,都被贪婪与恐惧所支配着。 稍不留神,便可能马失前蹄。 是驰骋在天堂里超凡入圣,还是在地狱里摸爬滚打,所有干系。 都寄于…… 指尖之上。这局讲述的是逐鹿之战之后,蚩尤再度复活想要再次统一全部族然后和一个拥有两个灵魂的青年“洺”相互争斗的是 命运玄之又玄,无数人不信命,却不得不成为命运中的一环。在时间的尽头,诠释着一个个早已安排好的阴谋,他只不过是一个引子…秦正穿越唐朝,竟因为一只鸟
辞职去当玄术师 精灵王纪年 幻灵:我是全球最强 鬼怪游戏 重生:回到八零当首富 磨世争雄 侠客诗 爆肝游戏宅的异世界生活 最狂兵王混都市 死灵德鲁伊 凰烬传 诸天战场:我能无限加点 神异制衡 随记空想 中等人 少年帝路 从求生游戏开始 末日求生之我没有挂 大宋江山第一部 屋后! 平胸漫画图片 六道的恶女们漫画33 绝对恋爱命令漫画75 耽美漫画小猫 平胸漫画图片 路飞与娜美的的漫画 暖床服务漫画 西雅小姐的漫画 路飞与娜美的的漫画 爱爱高清漫画 一个人漫画剪头发图片 一个人漫画剪头发图片 信乃长大漫画 六道的恶女们漫画33 韩国漫画玩火在线观看 虫子钻美女下体漫画 偶像 妻子漫画 在线王者天下漫画531 恋别人妈妈漫画图片 韩国漫画玩火在线观看 幸福的青鸟 漫画 韩国无码漫画在线观看视频 恋别人妈妈漫画图片 漫画。 手感 西雅小姐的漫画 本田未央本子漫画 在线王者天下漫画531 恋别人妈妈漫画图片 sm漫画耽美花 在线王者天下漫画531 耽美漫画小猫 幸福的青鸟 漫画 火影忍者博人传漫画乾 韩国漫画玩火在线观看 信乃长大漫画 虫子钻美女下体漫画 2015口工漫画排行榜 暖床服务漫画 信乃长大漫画 2015口工漫画排行榜 虫子钻美女下体漫画 blame漫画有新的嘛 粗点心战争漫画和动漫 偶像 妻子漫画 漫画一护最后的虚化 幸福的青鸟 漫画 一个人漫画剪头发图片 虫子钻美女下体漫画 本田未央本子漫画 黑道漫画大全免费下载 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 灵境圣者 终末序列 椅阑醉琼枝 轮回玉梅林 我爱我的刘大叔 亚星管理平台 葡京官网 AG真人 澳门葡京游戏官网 欧博官网 恋别人妈妈漫画图片 白马x平次漫画 2015口工漫画排行榜 漫画。 手感 平胸漫画图片 暖床服务漫画 黑道漫画大全免费下载 本田未央本子漫画 绝对恋爱命令漫画75 一个人漫画剪头发图片 信乃长大漫画 里番抖s漫画 幸福的青鸟 漫画 恋别人妈妈漫画图片 韩国漫画玩火在线观看 2015口工漫画排行榜 韩国无码漫画在线观看视频 在线王者天下漫画531 爱爱高清漫画 路飞与娜美的的漫画 2015口工漫画排行榜 信乃长大漫画 路飞与娜美的的漫画 幸福的青鸟 漫画 和宠物做的漫画 耽美飞飞漫画网 漫画。 手感 耽美飞飞漫画网 一个人漫画剪头发图片 韩国无码漫画在线观看视频