HTML 中的所有標(biāo)題標(biāo)簽,<h1> 到 <h6> 均可使用。另外,還提供了 .h1 到 .h6 類,為的是給內(nèi)聯(lián)(inline)屬性的文本賦予標(biāo)題的樣式。
<h1>h1. Bootstrap heading</h1>
<h2>h2. Bootstrap heading</h2>
<h3>h3. Bootstrap heading</h3>
<h4>h4. Bootstrap heading</h4>
<h5>h5. Bootstrap heading</h5>
<h6>h6. Bootstrap heading</h6>
在標(biāo)題內(nèi)還可以包含 <small> 標(biāo)簽或賦予 .small 類的元素,可以用來標(biāo)記副標(biāo)題。
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<h2>h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>
Bootstrap 將全局 font-size 設(shè)置為 14px,line-height 設(shè)置為 1.428。這些屬性直接賦予 <body> 元素和所有段落元素。另外,<p> (段落)元素還被設(shè)置了等于 1/2 行高(即 10px)的底部外邊距(margin)。
<p>...</p>
通過添加 .lead 類可以讓段落突出顯示。
<p class="lead">...</p>
variables.less 文件中定義的兩個 Less 變量決定了排版尺寸:@font-size-base 和 @line-height-base。第一個變量定義了全局 font-size 基準(zhǔn),第二個變量是 line-height 基準(zhǔn)。我們使用這些變量和一些簡單的公式計算出其它所有頁面元素的 margin、 padding 和 line-height。自定義這些變量即可改變 Bootstrap 的默認樣式。
標(biāo)簽定義帶有記號的文本用 <mark> 標(biāo)簽。
You can use the mark tag to <mark>highlight</mark> text.
對于被刪除的文本使用 <del> 標(biāo)簽。
<del>This line of text is meant to be treated as deleted text.</del>
對于沒用的文本使用 <s> 標(biāo)簽。
<s>This line of text is meant to be treated as no longer accurate.</s>
額外插入的文本使用 <ins> 標(biāo)簽。
<ins>This line of text is meant to be treated as an addition to the document.</ins>
為文本添加下劃線,使用 <u> 標(biāo)簽。
<u>This line of text will render as underlined</u>
利用 HTML 自帶的表示強調(diào)意味的標(biāo)簽來為文本增添少量樣式。
對于不需要強調(diào)的inline或block類型的文本,使用 <small> 標(biāo)簽包裹,其內(nèi)的文本將被設(shè)置為父容器字體大小的 85%。標(biāo)題元素中嵌套的 <small> 元素被設(shè)置不同的 font-size 。
你還可以為行內(nèi)元素賦予 .small 類以代替任何 <small> 元素。
<small>This line of text is meant to be treated as fine print.</small>
通過增加 font-weight 值強調(diào)一段文本。
<strong>rendered as bold text</strong>
用斜體強調(diào)一段文本。
<em>rendered as italicized text</em>
Alternate elements
在 HTML5 中可以放心使用 <b> 和 <i> 標(biāo)簽。<b> 用于高亮單詞或短語,不帶有任何著重的意味;而 <i> 標(biāo)簽主要用于發(fā)言、技術(shù)詞匯等。
通過文本對齊類,可以簡單方便的將文字重新對齊。
<p class="text-left">Left aligned text.</p>
<p class="text-center">Center aligned text.</p>
<p class="text-right">Right aligned text.</p>
<p class="text-justify">Justified text.</p>
<p class="text-nowrap">No wrap text.</p>
通過這幾個類可以改變文本的大小寫。
<p class="text-lowercase">Lowercased text.</p>
<p class="text-uppercase">Uppercased text.</p>
<p class="text-capitalize">Capitalized text.</p>
當(dāng)鼠標(biāo)懸停在縮寫和縮寫詞上時就會顯示完整內(nèi)容,Bootstrap 實現(xiàn)了對 HTML 的 <abbr> 元素的增強樣式。縮略語元素帶有 title 屬性,外觀表現(xiàn)為帶有較淺的虛線框,鼠標(biāo)移至上面時會變成帶有“問號”的指針。如想看完整的內(nèi)容可把鼠標(biāo)懸停在縮略語上(對使用輔助技術(shù)的用戶也可見), 但需要包含 title 屬性。
<abbr title="attribute">attr</abbr>
為縮略語添加 .initialism 類,可以讓 font-size 變得稍微小些。
<abbr title="HyperText Markup Language" class="initialism">HTML</abbr>
讓聯(lián)系信息以最接近日常使用的格式呈現(xiàn)。在每行結(jié)尾添加 <br> 可以保留需要的樣式。
<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>
<address>
<strong>Full Name</strong><br>
<a href="mailto:#">first.last@example.com</a>
</address>
在你的文檔中引用其他來源的內(nèi)容。
將任何 HTML 元素包裹在 <blockquote> 中即可表現(xiàn)為引用樣式。對于直接引用,我們建議用 <p> 標(biāo)簽。
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
</blockquote>
對于標(biāo)準(zhǔn)樣式的 <blockquote>,可以通過幾個簡單的變體就能改變風(fēng)格和內(nèi)容。
添加 <footer> 用于標(biāo)明引用來源。來源的名稱可以包裹進 <cite> 標(biāo)簽中。
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer>Someone famous in <cite title="Source Title">Source Title</cite>
</footer>
</blockquote>
<blockquote class="blockquote-reverse">
...
</blockquote>
<ul>
<li>...</li>
</ul>
<ol>
<li>...</li>
</ol>
移除了默認的 list-style 樣式和左側(cè)外邊距的一組元素(只針對直接子元素)。這是針對直接子元素的,也就是說,你需要對所有嵌套的列表都添加這個類才能具有同樣的樣式。
<ul class="list-unstyled">
<li>...</li>
</ul>
通過設(shè)置 display: inline-block; 并添加少量的內(nèi)補(padding),將所有元素放置于同一行。
<ul class="list-inline">
<li>...</li>
</ul>
帶有描述的短語列表。
<dl>
<dt>...</dt>
<dd>...</dd>
</dl>
.dl-horizontal 可以讓 <dl> 內(nèi)的短語及其描述排在一行。開始是像 <dl> 的默認樣式堆疊在一起,隨著導(dǎo)航條逐漸展開而排列在一行。
<dl class="dl-horizontal">
<dt>...</dt>
<dd>...</dd>
</dl>
通過 text-overflow 屬性,水平排列的描述列表將會截斷左側(cè)太長的短語。在較窄的視口(viewport)內(nèi),列表將變?yōu)槟J堆疊排列的布局方式。