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
春生夏长秋收冬藏txt不屑凰王宠txt平生不晚txt锦瑟华年txt新浪下载轮回三部曲txt春生夏长秋收冬藏txt庸人小说txt平生不晚txt大唐明月1txt网游天谴修罗txt盛世甜婚txt春生夏长秋收冬藏txt腹黑王爷金牌商妃txt下载盛世甜婚txt平生不晚txt网游天谴修罗txt诺言软语txt轮回三部曲txt轮回三部曲txt穿越明末当皇帝txt利诱txt下载成功txt下载?爰使┯ι?txt教你唱歌txt霸道狂少txt妙手药师txt下载锦瑟华年txt新浪下载无上真魔txt皇甫奇下载穿越明末当皇帝txt丞相你要对我负责txt生与死轮回不止,死亡永远是一切生命最大的劫难。 但倘若可以转世,而且可以携带一切记忆与意志转世又会如何? 无尽的转世,也许就是最大的诅咒吧! 诸天万界,仙古苍穹,帝者不过十人。本是先天剑体,天纵骄子,却惨遭陷害,葬剑百年。 我姜北玄修剑证道,不为别人,只为心中执念,剑气乾坤诸天,一剑苍穹万界——北玄之下再无剑帝。 蓝颜玉是智族的天才,天生智力无限,精神力初始三十级。在他十三岁时,离开了智族,入了阳暮言组织的拯救者奇团,认识了妖族的小公主美琥,金刚族王子艾果……在这其中竟还有来自异族的夜墨修,他是敌是友? 在剿灭异族的过程中,花界彼岸花——慕兮月与他相识、相知、相爱。之后的几次生死之战,导致拯救者大换血,面临着土崩瓦解,蓝颜玉是否能重振拯救者奇团?在世界即将要毁灭时,他又能否拯救世界?万仙求道,万道来朝! 三百年前,陈少君被师父带上仙门,因为血脉原因难以练武,但却在炼器上天赋异禀,成为一代器君,与宗门六位师兄合称“北斗七圣”。 一场剧变,师父被害,北斗陨落,陈少君谪落人间,转生成为大商户部侍郎之子。 光阴荏苒,如今的他只是人间蝼蚁般凡人。 然而,这场剧变也同样打开了他身上的限制。 师父:“如果不是血脉的限制,你的成就就连师父也难以想像!” 书生宣讲,鬼神听道! 且看昔日器君如何一步步崛起,临天路,朝仙道,让诸天万界都为之颤抖! —— 欢迎大家关注我的微信公众号,关注请搜索皇甫奇。 QQ群:422905216陈晓穿越大唐贞观初年,继承了家中位于长安东市的酒楼。 哪知那唐皇李世民化名李二哥,成了酒楼的常客。 推杯换盏之余,李世民的问题也越来越奇怪: “陈掌柜,突厥屡屡南下劫掠,可有一劳永逸的办法?” “陈掌柜,蝗灾荼毒天下,朝廷应当如何应对?” “陈掌柜,天下之大,我大唐铁骑如何能雄霸天下?” 陈晓有些头疼,我就一开饭馆的,你总问我这干啥? 关键是,大唐铁骑怎么还真雄霸天下了?GDI的宿将在踏上另一条不归路的前一天,被卷入了漫长的征程。 “你难道不认为自己很失败?” 麦克尼尔看着李林手上的十字形疤痕,若有所思。 “我曾经活在末日一般的地方,什么事情是不失败的?” 一个英雄的陨落。 尽管披着CNC的皮,实际上并未包含任何CNC内容。 QQ群:574110653,欢迎讨论设定。 ————— 标签:命令与征服、红色警戒、Code Geass叛逆的鲁路修、魔劣、攻壳机动队、超时空要塞、龙背上的骑兵、尼尔机械纪元、心理测量者、使命召唤、全金属狂潮、生化危机、东京喰种、恶魔城、樱花大战、仁王。天狼星是缆镇龙头老二施边边的绰号。 施边边出道前是读过好几本古书的。 会背东坡老师的《江城子 · 密州出猎 》:老夫聊发少年狂,左牵黄,右擎苍。 锦帽貂裘,千骑卷平岗。 为报倾城随太守,亲射虎,看孙郎。 酒酣胸胆尚开张,鬓微霜,又何妨! 持节云中,何日遣冯唐? 会挽雕弓如满月,西北望,射天狼。 客厅还请苍梧先生写了这首词,裱了起来,比起龙头老大钱鼓鼓只喜欢收藏所谓的玉石原石好多了。 钱鼓鼓收的所谓玉石原石全部来自云南,不知真假! 缆镇以前没有什么工业,所谓的工业就是做木质工艺品,因此木头原料是关键。 钱鼓鼓和施边边二个人垄断了缆镇的木头市场。 后来,缆镇开始搞建设,鼓捣水泥搅拌站是来钱快的生意,钱鼓鼓和施边边二人开始了水泥搅拌站的布局。 故事就这样开始了!不会种田的乡村少年牛小田,误打误撞拜师老神仙,看相风水医术道法无所不能,从此人生开挂。骑着青牛的高傲御姐自称‘老子出关’,喋喋不休,婷婷身段的唐三藏名副其实‘秀色可餐’、还有那蚩尤和黄帝为了谁是霸道女王在涿鹿大战三百场。 纵观山海经,西游记和封神榜的神仙们各个都变成美人国色天香。 别说了,悟空妹妹,赶快借我金箍棒。 一枚丹药如何拯救世界?周九天一个赘婿之子,如何逆风而行?
帝玄纪 一道青焰 仙界捡漏人 神豪:我呼吸就赚钱 乱世货郎 宗门里连我都是卧底 海贼里的傀儡之剑 君临山海 一壶酒,浮世三千 综漫:我是穿越者的噩梦 都市:不想努力却逆袭 万古绝顶 重生之我的侄儿是天选? 陌上花开之徐徐而归 武林剑客! 签到元宇宙,从意念建模开始无敌 玄凌大陆 铁浮屠:世界的长城 返祖我的先祖是曹孟德 过去的三分之一 网游天谴修罗txt 无上真魔txt皇甫奇下载 诺言软语txt 轮回三部曲txt 不屑凰王宠txt 老炮儿是怎样练成的txt 少年总裁之校园纵横txt 黑心佛txt下载 老炮儿是怎样练成的txt 腹黑王爷金牌商妃txt下载 ?爰使┯ι?txt ?爰使┯ι?txt 教你唱歌txt 网游天谴修罗txt 春生夏长秋收冬藏txt 霸道狂少txt 华夏战龙txt在线阅读 妙手药师txt下载 寻找前世之旅第二部txt 春生夏长秋收冬藏txt 日本的起起落落txt 平生不晚txt 寻找前世之旅第二部txt 成功txt下载 黑心佛txt下载 欧也妮·葛朗台txt 妙手药师txt下载 寻找前世之旅第二部txt 利诱txt下载 妙手药师txt下载 轮回三部曲txt 日本的起起落落txt 锦瑟华年txt新浪下载 春生夏长秋收冬藏txt 教你唱歌txt 霸道狂少txt 科技主宰txt下载 少年总裁之校园纵横txt 教你唱歌txt 科技主宰txt下载 霸道狂少txt 安晴小说txt 穿越明末当皇帝txt 华夏战龙txt在线阅读 盛世甜婚txt 日本的起起落落txt ?爰使┯ι?txt 霸道狂少txt 欧也妮·葛朗台txt 庸人小说txt 亚星官网 亚星官网 亚星官网 亚星官网 亚星官网 哲学家与冒险家 武都伏妖录 秦卒 我在古代直播带货 导师对我很特殊 澳门葡京游戏官网 葡京官网 AG真人 澳门葡京游戏官网 欧博游戏官网 不屑凰王宠txt 少年总裁之校园纵横txt 庸人小说txt 穿越明末当皇帝txt 少年总裁之校园纵横txt 大唐明月1txt 教你唱歌txt 大唐明月1txt 网游天谴修罗txt 寻找前世之旅第二部txt 日本的起起落落txt 锦瑟华年txt新浪下载 老炮儿是怎样练成的txt 日本的起起落落txt 教你唱歌txt 日本的起起落落txt 华夏战龙txt在线阅读 黑心佛txt下载 网游天谴修罗txt 不屑凰王宠txt 黑心佛txt下载 丞相你要对我负责txt 寻找前世之旅第二部txt 庸人小说txt 安晴小说txt 少年总裁之校园纵横txt 锦瑟华年txt新浪下载 欧也妮·葛朗台txt 霸道狂少txt ?爰使┯ι?txt