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
邮票图片邮票图片邮票吧中国邮票价格表邮票收藏猴年邮票鸡年邮票文革邮票第三轮生肖邮票鸡年邮票架空历史+穿越异界+女帝+多女主 他与网恋小女友打电话,突发意外,离奇穿越异界,却遇到成为女帝的网恋小女友,这期间到底发生了什么? 他落在一张床上,可这却是女帝的凤榻,他将如何抉择? 他舌战朝堂群臣,可女帝却不是很满意,他将如何应对? 他制作现代的物品,可女帝不止想要一样,他将如何满足? 他征伐大陆永不歇,可女帝仍旧保持否认,他将如何证明? 他功高盖主欲娶帝,但女帝最后如何选择,他最后能否娶? 一位新时代青年在异界的成帝之路,他将如何一步步登顶帝位与女帝同起同坐。 让我们拭目以待吧!没有命运,仅有人铺垫出之坎坷道途 没有净土,仅有人开凿出之世外桃园 - 一把王者圣剑,为黑夜带来光明 一个不屈英魂,为世间燃点希望 - 觉醒灵魂,少年鏖战神魔; 暗云涌动,泛起灭世争端! - 光暗冲突,大战一触即发; 人神决战,再写创世诗篇!一场意外的车祸,让李继深丧失了意识,医生对他开始了全力的抢救。醒来他成了南宋皇帝赵构,每当寿命已尽,便会成为下一个王朝的皇帝,这究竟是怎么回事?当回到现代,文明已高度发达,李继深已分辨不出这个世界是真实的,还是虚拟的。他曾为了修行背叛师门,却还是陨落在心魔之下。复生在海贼世界的他,决定放下执念,潇洒的活一次。世界末日,是真的结束?还是新的开始?人类进化,天赋崛起,活下去,比什么都重要。九州神王李长青,被兄弟偷袭陨落,却意外重生归来。 尘封万年的洪荒大妖,将成为他的助力, 万界之中,修最强之术,炼顶尖灵药,布绝妙大阵…… “前世我能登临巅峰,这一世我也一样可以,诸天万界,终有一天,我会卷土重来!” 他的徒弟生前收的七个绝色女弟子最近遇到了麻烦,时隔千年再度出山。 苏阳:我想退休了! 七个女弟子:不,你不想! 颓废的陆回穿越到20年前的初中,重拾激情。在他奋斗的过程中,历史也悄然改变。陆回不仅成就了一番事业,也获得了众多芳心。不追求CP结合,架空历史的一部帮派穿越小说! 道上老大白楚阳,在一次斗殴中被人刺杀,结果直接穿越到数百年前的白氏家族。 为了能让自己存活下去,同名同姓的白楚阳,使出自己在现代混迹的所有本领,让这个古代的白氏家族,逐渐成为一方霸主! 生活没有那么多幸运,更多的是拼搏。没有那么多辉煌,更多的是平凡,苦中作乐。躲在角落里抹去泪水还要去面对,无论结果如何,至少我们在不断的为了生活而拼搏。
邮票收藏 中国邮票 邮票网 邮票行情 中国邮票价格表 女幽灵 百度网盘下载 迅雷下载 大龙邮票 鸡年邮票 大龙邮票 鸡年邮票 民居邮票 邮票市场 邮票收藏 纪念邮票 邮票市场 龙邮票 世界上第一枚邮票 奥运邮票 女幽灵 百度网盘下载 迅雷下载 邮票交易所 生肖邮票 上海邮票网 鸡年邮票 邮票收藏价格表 鸡年邮票 邮票收藏 民居邮票 中国邮票 民居邮票 邮票收藏价格表 第三轮生肖邮票 世界上第一枚邮票 第三轮生肖邮票 邮票互动网 大龙邮票 南京文交所钱币邮票交易中心 纪念邮票 纪念邮票 龙邮票 欧美群迅雷下载 重生官路重重星垣九幽元宇宙天宫穿越古代我让家族称霸一方御灵逆天之旅龙凤令九撄圣佛隐藏着的高手爱在下一个世界复苏越空行者震惊,我的视频通未来!星赐之缘吾有千万分身 单手压诸神楚回的世界带着网友去穿越玄幻:我能查看万物词条我在大楚当汉王道天之上一世成仙残阳起风雷窗帘进货请复制到浏览器打开 不锈钢家具 中虹花苑小区房价 小区类型 移动货架车 北京实木家具厂 雅美娜马桶 金线厂家 涟水二手房 窗帘上折水波裁剪图解 北京搬家公司口碑好 实木衣柜厂家 水波的裁剪方法正水波 惠达卫浴排名第几 恒杰马桶 南红玛瑙价格 奥林匹克大厦的房价 广州衣柜厂家 天津家具 水波窗幔图 天猫 淘宝商城鞋柜带衣柜 沙发凳 真皮 浴室柜最大工厂 左右 沙发 动态调节式框架结构 窗帘等分尺 澧县二手房 南关小区房价 意合小区 单位电话 六安小区 华胜小区 hcg卫浴 蚂蚁搬家电话昆明 蠡县二手房 沈阳搬家公司 我欢迎 风帆蓄电池价格表 牧隆货架 刨花板衣柜 马歌浴室柜 环孔材 家具 仓库货位地图 沙发后背高低不一怎样选沙发巾 杭州市半道 红二手房房价 厦门二手房网 运城小区 整体衣柜价格 北京房价多少 宝鸡沙发家具 松江新城搬家公司 深圳市超市货架 华日家具股份有限公司 芙蓝衣柜 踢脚线厂家 郫县门厂家 窗帘店前景 南宁搬家公司的电话号码 楼空水波 防水窗帘 虹口二手房出售 窗帘+柯桥 福清二手房出售 房价上涨 松岗搬家电话 油烟机厂家 东莞货架哪家好 挤塑板价格 合金窗价格 百丽浴室柜 包头小区 定制衣柜侧板 弯 深圳龙华新区个人搬家公司 朴树价格 温州搬家公司电话 根雕茶几价格 临沂河东搬家公司电话号码 卷帘门价格 朝阳市搬家公司电话 隔热窗厂家 北京海淀中关村租房价 西安 沙发定做 天津房价网 定做衣柜 成都 郑州东史马安置小区 纸墙纸价格 广州 大众 搬家公司电话 民安小区暖气不热 欧式衣柜效果图 彩瓦厂家 青岛搬家公司 电话 武汉搬家公司怎么收费标准 窗帘孔直径 马桶详解 挂壁式浴室柜安装高度 广东家具厂 苍南中梁房价多少 施迈尔嘉实木浴室柜价格 扁铁价格 正水波的制作方法 热水器厂家 杭州 房价 立体仓库设备 石英石台面价格 上海大众服务电话多少