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
网站打模块做网站资讯营销培训课程体系江西专业南昌网站建设最优秀的佛山网站建设关于信息安全的 国标乌克兰事件 信息安全万州网站制作自贡网站建设网络安全服务保障方案什么不属于网络安全技术洮南网站网络营销策划书的撰写天津学网站建设网络安全法 肉鸡武威做网站关于信息安全的 国标乌克兰事件 信息安全网络营销课程设计总结计算机等级信息安全如何做好网络营销投资网络安全产品检测报告市场营销和关系营销网络营销英文怎么读xcon安全焦点信息安全技术峰会唐山网站建设哪家优惠国家网络安全审查张家港杨舍网站制作音乐网站如何建设的网站整站云彩网站简易静态网站制作流程图我叫杨辰光,身高一米五。 虽说比不上黎明,郭富城那样的大帅哥,但怎么说也是有点姿色的,矮一点怎么了!? 浓缩的才是精华! 也不知道是哪个混蛋给我取了一个艹蛋的绰号,居然叫我光棍!? 想当年大郎还能娶金莲呢! 想让哥打光棍? 门儿都没有!穿越到大乾王朝的陈河,入赘叶家,本想着这辈子要不做个赘婿吧。   混吃等死算了。   谁想到新婚妻子娇艳如花,奈何天生体弱,红颜多薄命。   一本《伤寒论*小青龙汤》救了新婚的妻子。   一本《本草纲目》本奉为万世医典。   《神农本草经》济世悬壶,引得天下医道追逐。   多年以后,看着自己的济贤堂开遍大乾,陈河本想着这辈子也就这样过吧,娶个七八房媳妇,生个十几个娃,但没想到大乾内乱。   一纸诏令直达应天。   宣:陈河入宫!大家好,我是伍浩,我的人生最巅峰是成为一家上市公司的COO,而当事业进入稳定期时,我的噩耗也来了...   修仙界至尊医尊徐辰,重回到了地球当实习医生的日子,自此改变他的人生,再努力重返仙界。   他有医死人活白骨的医术本领,在都市生活里逍遥又快活。   富家女,青梅竹马,女记者,老师……   都成为了他的崇拜者。   我命由我不由天。   一剑指苍穹,快活人世间!   我笑这苍生都在我脚下,皆为我臣服!     “有请我的世界个人pk赛冠军陆瑜先生上台领奖!” “有请我的世界跑酷竞速赛冠军,陆瑜先生上台领奖。” “有请起床战争总局赛FMVP选手,陆瑜先生上台领奖!” “有请我的世界红石挑战赛冠军,陆瑜先生上台领奖!”  …… 陆瑜:“能不能给我搬一把椅子上来,领个奖跑上跑下怪累的。” “对了,麻烦再给我准备一辆货车 ,我怕奖杯太多,待会带不走。” “谢谢,有请下一位嘉宾给我颁奖。” “你小子莫装逼!装逼可是要……” 轰隆隆—— 全能玩家陆瑜被雷劈死后,竟然转生成方块大陆的村民。 还是个傻子! 幸好,游戏的Minecraft的系统还在,成为傻子村民陆瑜从零开始方块大陆的生活。 【恭喜解锁一键砍树MOD!】 【恭喜解锁食物工艺MOD!】 【恭喜解锁拔刀剑MOD!】 “陆瑜,你怎么做到的?” “阿巴阿巴阿巴。” 陆瑜不知道,不关陆瑜的事儿。段白云生来无缘仙道。 一句谣言,一朝灭门。 流落到云峰大陆的段白云机缘巧合开启了修仙之路。 他拿着万众执念的东西重回天洲,又将那东西摔落泥泞。 段白云:我就要以我废材之名告诉他们,不是什么人都能够飞升成神! 筑灵基,破灵笼,一步一点上天宫,   忆往生,修前程,彼岸尽头照三身。   仙台拂净红尘路,退隐闭居为仙人,   世人皆求长生种,仙路尽头皆为空。他,后脑勺多出一块骨头,出生时正好父亲海上遇难,于是他被叶家当作是反骨仔、煞星灾星,是江海豪门叶家没落的罪魁祸首,所以他从小在叶家受尽欺凌,活的不如一条狗,甚至,还被叶家利用亲生母亲,逼他联姻宋家第一丑女千金。殊不知,得到了阴阳鱼玉佩的他不仅成为了悬壶济世的圣手神医,还是杀伐果断的神州大将。 且看他退役回归都市,在保护好自己想要保护的人下,是如何将都市掀起一阵狂风暴雨,是如何让整个世界都为之一颤……天下已乱,战火纷飞,百姓水深火热。 奸臣当道,忠臣受迫,庙堂妖风邪气。 此时,江流正在赶往金陵的路上。 ”忧苍生之所忧,愁国君之所愁。“ ”我江流就是要开创个太平盛世!“ 五族纷争战不断, 三国史实卷中现, 为得永生长修道, 万法归一只逆天。 异境修仙,只得逆天,任意杀戮,天地共怒,若无后源,人神必灭。 世尊苍天,其女名杰,上古平乱,世尊圣女,其有词,临江赋―大江东去明月夜,千里碧霞寒光生,江明月,对影浊,月映当空星自薄,临望江面银闪烁,东进山,踏峰坡,游牧组中将临敌,吾族儿女何惧多,对阵南蛮欲血搏,将临难,欲长歌,声划长空欲九霄,势破地渊惊醒天,举剑指天问明月,映在高空何时多,吾虽柔弱小女子,愿做杀敌女丈夫,守吾华下永太平,父乃上古一天帝,子女岂能弱丈夫,今日挥剑立天地,誓守吾族疆域全,那怕上存一气在,战至身死不退步,即便不幸离于世,凝心聚魂守疆土。
手机版网站建设开发 初级信息安全测评师 武威做网站 初级信息安全测评师 万州网站制作 美国信息安全市场规模 郑州网络营销服务 信息安全 开源 教育行业 网络安全 网络营销策划书的撰写 企业级服务 网络安全 王老吉营销事件 蘑菇街网络营销方案 西安网站架设公司 移动端网络营销推广方案 网址营销 东莞长安网络营销招聘信息 网络安全建设方案 微博营销的swot 响应式外贸网站案例 深圳网站空间 高端网站设计品牌 零食网络营销策划方案 太原网站开发哪家好 计算机网络工程!|辅修程序设计网络安全等课程! 建网站费用 长沙哪里做网站好 天津网站建设公司 国家信息安全实验室主任 盐山网站建设 网页类网站 浙江网站建设 计算机等级信息安全 广州网站设计 思科 企业网络安全解决方案网络e营销 央视 路由器暗埋网络安全地雷 郑州网站建设公司 网上平台营销策划 响应式外贸网站案例 网络内容营销意识