亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

第二章之Bootstrap 頁面排版樣式

 更新時(shí)間:2016年04月25日 10:57:19   作者:水之原  
Bootstrap 是基于 HTML、CSS、JAVASCRIPT 的,它簡(jiǎn)潔靈活,使得 Web 開發(fā)更加快捷。本文給大家介紹Bootstrap 頁面排版樣式的相關(guān)知識(shí),希望對(duì)大家有所幫助!

Bootstrap,來自 Twitter,是目前最受歡迎的前端框架。Bootstrap 是基于 HTML、CSS、JAVASCRIPT 的,它簡(jiǎn)潔靈活,使得 Web 開發(fā)更加快捷。

學(xué)習(xí)要點(diǎn):

1.頁面排版

本節(jié)課我們主要學(xué)習(xí)一下 Bootstrap 全局 CSS 樣式中的排版樣式,包括了標(biāo)題、頁面主體、對(duì)齊、列表等常規(guī)內(nèi)容。

一.頁面排版

Bootstrap 提供了一些常規(guī)設(shè)計(jì)好的頁面排版的樣式供開發(fā)者使用。

1.頁面主體

Bootstrap 將全局 font-size 設(shè)置為 14px,line-height 行高設(shè)置為 1.428(即20px);<p>段落元素被設(shè)置等于 1/2 行高(即 10px);顏色被設(shè)置為#333。

//創(chuàng)建包含段落突出的文本
<p>Bootstrap 框架</p>
<p class="lead">Bootstrap 框架</p>
<p>Bootstrap 框架</p>
<p>Bootstrap 框架</p>
<p>Bootstrap 框架</p> 

2.標(biāo)題

//從 h1 到 h6
<h1>Bootstrap 框架</h1>//36px
<h2>Bootstrap 框架</h2>//30px
<h3>Bootstrap 框架</h3>//24px
<h4>Bootstrap 框架</h4>//18px
<h5>Bootstrap 框架</h5>//14px
<h6>Bootstrap 框架</h6>//12px 

我們從 Firebug 查看元素了解到, Bootstrap 分別對(duì) h1 ~ h6 進(jìn)行了 CSS 樣式的重構(gòu),并且還支持普通內(nèi)聯(lián)元素定義 class=(.h1 ~ h6)來實(shí)現(xiàn)相同的功能。

//內(nèi)聯(lián)元素使用標(biāo)題字體
<span class="h1">Bootstrap</span> 

注:通過 Firebug 查看元素還看到,字體顏色、字體樣式、行高均被固定了,從而保證了統(tǒng)一性,而原生的會(huì)根據(jù)系統(tǒng)內(nèi)置的首選字體決定,顏色是最黑色。

在 h1 ~ h6 元素之間,還可以嵌入一個(gè) small 元素作為副標(biāo)題,

//在標(biāo)題元素內(nèi)插入 small 元素
<h1>Bootstrap 框架 <small>Bootstrap 小標(biāo)題</small></h1>
<h2>Bootstrap 框架 <small>Bootstrap 小標(biāo)題</small></h2>
<h3>Bootstrap 框架 <small>Bootstrap 小標(biāo)題</small></h3>
<h4>Bootstrap 框架 <small>Bootstrap 小標(biāo)題</small></h4>
<h5>Bootstrap 框架 <small>Bootstrap 小標(biāo)題</small></h5>
<h6>Bootstrap 框架 <small>Bootstrap 小標(biāo)題</small></h6> 

通過 Firebug 查看,我們發(fā)現(xiàn) h1 ~ h3 下 small 元素的大小只占父元素的 65%,那么通過計(jì)算(查看 Firebug 計(jì)算后的樣式), h1 ~ h3 下的 small 為 23.4px、 19.5px、 15.6px;h4 ~ h6 下 small 元素的大小只占父元素的 75% ,分別為:13.5px、10.5px、9px。在 h1 ~ h6 下的 small 樣式也進(jìn)行了改變,顏色變成淡灰色:#777,行高為 1,粗度為 400。

3.內(nèi)聯(lián)文本元素

//添加標(biāo)記,<mark>元素或.mark 類
<p>Bootstrap<mark>框架</mark></p> 
//各種加線條的文本
<del>Bootstrap 框架</del>//刪除的文本
<s>Bootstrap 框架</s>//無用的文本
<ins>Bootstrap 框架</ins>//插入的文本
<u>Bootstrap 框架</u>//效果同上,下劃線文本 
//各種強(qiáng)調(diào)的文本
<small>Bootstrap 框架</small>//標(biāo)準(zhǔn)字號(hào)的 85%
<strong>Bootstrap 框架</strong>//加粗 700
<em>Bootstrap 框架</em>//傾斜 

4.對(duì)齊

//設(shè)置文本對(duì)齊
<p class="text-left">Bootstrap 框架</p>//居左
<p class="text-center">Bootstrap 框架</p>//居中
<p class="text-right">Bootstrap 框架</p>//居右
<p class="text-justify">Bootstrap 框架</p>//兩端對(duì)齊,支持度不佳<p class="text-nowrap">Bootstrap 框架</p>//不換行 

5.大小寫

//設(shè)置英文文本大小寫
<p class="text-lowercase">Bootstrap 框架</p> //小寫
<p class="text-uppercase">Bootstrap 框架</p> //大寫
<p class="text-capitalize">Bootstrap 框架</p>//首字母大寫

6.縮略語

//縮略語
Bootstrap<abbr title="Bootstrap" class="initialism">框架</abbr>

7.地址文本

//設(shè)置地址,去掉了傾斜,設(shè)置了行高,底部 20px
<address>
  <strong>Twitter, Inc.</strong><br>
  795 Folsom Ave, Suite 600<br>
  San Francisco, CA 94107<br>
  <abbr title="Phone">P:</abbr> (123) 456-7890
</address>

8.引用文本

//默認(rèn)樣式引用,增加了做邊線,設(shè)定了字體大小和內(nèi)外邊距
<blockquote>
  Bootstrap 框架
</blockquote> 
//反向
<blockquote class="blockquote-reverse ">
  Bootstrap 框架
</blockquote>

9.列表排版

//移出默認(rèn)樣式
<ul class="list-unstyled">
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
</ul> 
//設(shè)置成內(nèi)聯(lián)
<ul class="list-inline">
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
  <li>Bootstrap 框架</li>
</ul> 
//水平排列描述列表
<dl class="dl-horizontal">
  <dt>Bootstrap</dt>
  <dd>Bootstrap 提供了一些常規(guī)設(shè)計(jì)好的頁面排版的樣式供開發(fā)者使用。</dd>
</dl> 

10.代碼

//內(nèi)聯(lián)代碼
<code>&lt;section&gt;</code> 
//用戶輸入
press <kbd>ctrl + ,</kbd> 
//代碼塊
<pre>&lt;p&gt;Please input...&lt;/p&gt;</pre> 

Bootstrap 還列舉了<var>表示標(biāo)記變量,<samp>表示程序輸出,只不過沒有重新復(fù)寫 CSS。

以上所述是小編給大家介紹的Bootstrap 頁面排版樣式的相關(guān)知識(shí),希望對(duì)對(duì)大家有所幫助!

相關(guān)文章

最新評(píng)論