Typography
Cov ntaub ntawv thiab cov piv txwv rau Bootstrap typography, suav nrog cov chaw thoob ntiaj teb, cov ncauj lus, cov ntawv hauv lub cev, cov npe, thiab lwm yam.
Kev teeb tsa thoob ntiaj teb
Bootstrap teeb tsa lub ntiaj teb cov zaub, typography, thiab txuas cov qauv. Thaum xav tau kev tswj ntau dua, mus saib cov chav kawm ntawv siv hluav taws xob .
- Siv cov kab ntawv ib txwm muaj uas xaiv qhov zoo tshaj plaws
font-family
rau txhua OS thiab ntaus ntawv. - Rau ntau qhov sib xyaw thiab siv tau hom nplai, peb siv qhov browser lub hauv paus pib
font-size
(feem ntau 16px) yog li cov neeg tuaj saib tuaj yeem kho lawv qhov browser raws li xav tau. - Siv cov
$font-family-base
,$font-size-base
, thiab$line-height-base
cov cwj pwm raws li peb lub hauv paus typographic siv rau<body>
. - Teem lub ntiaj teb txuas xim ntawm
$link-color
thiab siv qhov txuas hauv qab tsuas yog rau:hover
. - Siv
$body-bg
los teeb tsabackground-color
rau ntawm<body>
(#fff
los ntawm lub neej ntawd).
Cov qauv no tuaj yeem pom nyob rau hauv _reboot.scss
, thiab lub ntiaj teb hloov pauv tau txhais hauv _variables.scss
. Nco ntsoov teem $font-size-base
rau hauv rem
.
Cov ntsiab lus
Tag nrho cov ntsiab lus HTML, <h1>
dhau los <h6>
, muaj.
Lub taub hau | Piv txwv |
---|---|
<h1></h1> |
h 1. Bootstrap taub hau |
<h2></h2> |
h 2. Bootstrap taub hau |
<h3></h3> |
h 3. Bootstrap taub hau |
<h4></h4> |
h 4. Bootstrap taub hau |
<h5></h5> |
h 5. Bootstrap taub hau |
<h6></h6> |
h 6. Bootstrap taub hau |
<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>
.h1
los ntawm .h6
cov chav kawm kuj muaj, rau thaum koj xav kom phim cov font styling ntawm ib nqe lus tab sis tsis tuaj yeem siv cov ntsiab lus HTML cuam tshuam.
h 1. Bootstrap taub hau
h 2. Bootstrap taub hau
h 3. Bootstrap taub hau
h 4. Bootstrap taub hau
h 5. Bootstrap taub hau
h 6. Bootstrap taub hau
<p class="h1">h1. Bootstrap heading</p>
<p class="h2">h2. Bootstrap heading</p>
<p class="h3">h3. Bootstrap heading</p>
<p class="h4">h4. Bootstrap heading</p>
<p class="h5">h5. Bootstrap heading</p>
<p class="h6">h6. Bootstrap heading</p>
Customizing cov npe
Siv cov chav kawm siv hluav taws xob los tsim cov ntawv me me thib ob ntawm Bootstrap 3.
Fancy zaub heading Nrog faded thib ob cov ntawv nyeem
<h3>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h3>
Tso cov kab ntawv
Cov ntsiab lus tseem ceeb yog tsim los ua haujlwm zoo tshaj plaws hauv cov nqaij ntawm koj nplooj ntawv cov ntsiab lus. Thaum koj xav tau lub ntsiab lus los sawv tawm, xav txog kev siv cov lus qhia - qhov loj dua, me ntsis kev xav txog cov ntsiab lus. Nco ntsoov cov ncauj lus no tsis teb los ntawm lub neej ntawd, tab sis nws muaj peev xwm los pab kom teb cov ntawv loj .
Zaub 1 |
Zaub 2 |
Zaub 3 |
Zaub 4 |
<h1 class="display-1">Display 1</h1>
<h1 class="display-2">Display 2</h1>
<h1 class="display-3">Display 3</h1>
<h1 class="display-4">Display 4</h1>
Coj
Ua ib kab lus sawv tawm los ntawm kev ntxiv .lead
.
Qhov no yog ib kab lus coj. Nws sawv tawm ntawm cov kab lus tsis tu ncua.
<p class="lead">
This is a lead paragraph. It stands out from regular paragraphs.
</p>
Cov ntsiab lus hauv kab ntawv
Styling rau cov ntsiab lus hauv HTML5.
Koj tuaj yeem siv lub cim cim rautseem ceebntawv nyeem.
Cov kab ntawv no yog txhais tau tias yuav raug kho raws li cov ntawv deleted.
Cov kab ntawv no txhais tau tias yuav raug kho raws li qhov tsis raug lawm.
Cov kab ntawv no yog txhais tau tias yuav raug kho raws li qhov ntxiv rau daim ntawv.
Cov kab ntawv no yuav ua raws li hauv qab
Cov kab ntawv no yog txhais tau tias yuav tsum tau kho raws li kev luam zoo.
Cov kab no ua raws li cov ntawv sau siab.
Cov kab no ua raws li cov ntawv italicized.
<p>You can use the mark tag to <mark>highlight</mark> text.</p>
<p><del>This line of text is meant to be treated as deleted text.</del></p>
<p><s>This line of text is meant to be treated as no longer accurate.</s></p>
<p><ins>This line of text is meant to be treated as an addition to the document.</ins></p>
<p><u>This line of text will render as underlined</u></p>
<p><small>This line of text is meant to be treated as fine print.</small></p>
<p><strong>This line rendered as bold text.</strong></p>
<p><em>This line rendered as italicized text.</em></p>
.mark
thiab .small
cov chav kawm kuj tseem muaj los siv cov qauv zoo ib yam li <mark>
thiab <small>
thaum tsis txhob muaj qhov cuam tshuam tsis zoo uas cov cim npe yuav coj mus.
Thaum tsis tau qhia saum toj no, xav siv dawb <b>
thiab <i>
hauv HTML5. <b>
yog txhais tau hais tias tseem ceeb cov lus lossis kab lus yam tsis muaj qhov tseem ceeb ntxiv thaum <i>
feem ntau yog rau lub suab, cov lus qhia, thiab lwm yam.
Cov ntawv nyeem
Hloov cov ntawv sib dhos, hloov pauv, style, qhov hnyav, thiab xim nrog peb cov ntawv siv hluav taws xob thiab cov khoom siv xim .
Cov ntawv luv
Stylized siv HTML lub <abbr>
ntsiab lus rau cov ntawv luv thiab cov ntawv sau los qhia cov ntawv nthuav dav ntawm hover. Cov ntawv luv luv muaj lub ntsiab lus hauv qab thiab tau txais tus cursor pab los muab cov ntsiab lus ntxiv ntawm kev txav mus los thiab rau cov neeg siv cov cuab yeej pabcuam.
Ntxiv .initialism
rau cov ntawv luv rau me me font-loj.
attr
HTML
<p><abbr title="attribute">attr</abbr></p>
<p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr></p>
Blockquotes
Rau quoting blocks ntawm cov ntsiab lus los ntawm lwm qhov chaw hauv koj cov ntaub ntawv. Qhwv <blockquote class="blockquote">
ib ncig ntawm HTML raws li cov lus tsocai.
Ib qho zoo-paub quotes, muaj nyob rau hauv ib lub ntsiab lus blockquote.
<blockquote class="blockquote">
<p class="mb-0">A well-known quote, contained in a blockquote element.</p>
</blockquote>
Sau npe qhov chaw
Ntxiv <footer class="blockquote-footer">
rau kev txheeb xyuas qhov chaw. Muab lub npe ntawm qhov chaw ua haujlwm hauv <cite>
.
Ib qho zoo-paub quotes, muaj nyob rau hauv ib lub ntsiab lus blockquote.
<blockquote class="blockquote">
<p class="mb-0">A well-known quote, contained in a blockquote element.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
Kev sib tw
Siv cov ntawv siv hluav taws xob raws li xav tau los hloov qhov sib npaug ntawm koj qhov blockquote.
Ib qho zoo-paub quotes, muaj nyob rau hauv ib lub ntsiab lus blockquote.
<blockquote class="blockquote text-center">
<p class="mb-0">A well-known quote, contained in a blockquote element.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
Ib qho zoo-paub quotes, muaj nyob rau hauv ib lub ntsiab lus blockquote.
<blockquote class="blockquote text-right">
<p class="mb-0">A well-known quote, contained in a blockquote element.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
Cov npe
Tsis zoo li
Tshem tawm lub neej ntawd list-style
thiab sab laug ntawm cov npe khoom (cov me nyuam tam sim ntawd). Qhov no tsuas yog siv rau cov menyuam yaus tam sim ntawd sau cov khoom , txhais tau tias koj yuav tsum tau ntxiv cov chav kawm rau cov npe nested ib yam nkaus.
- Nov yog daim ntawv teev npe.
- Nws zoo nkaus li unstyled kiag li.
- Structurely, nws tseem yog ib daim ntawv teev npe.
- Txawm li cas los xij, qhov style no tsuas yog siv rau cov menyuam yaus tam sim ntawd.
- Nested npe:
- tsis cuam tshuam los ntawm qhov style no
- tseem yuav pom ib lub mos txwv
- thiab muaj cov npoo sab laug uas tsim nyog
- Qhov no tseem tuaj yeem ua tau yooj yim hauv qee qhov xwm txheej.
<ul class="list-unstyled">
<li>This is a list.</li>
<li>It appears completely unstyled.</li>
<li>Structurally, it's still a list.</li>
<li>However, this style only applies to immediate child elements.</li>
<li>Nested lists:
<ul>
<li>are unaffected by this style</li>
<li>will still show a bullet</li>
<li>and have appropriate left margin</li>
</ul>
</li>
<li>This may still come in handy in some situations.</li>
</ul>
Hauv kab
Tshem tawm cov npe cov mos txwv thiab siv qee lub teeb margin
nrog kev sib xyaw ntawm ob chav kawm, .list-inline
thiab .list-inline-item
.
- Nov yog ib daim ntawv teev npe.
- Thiab lwm tus.
- Tab sis lawv nyob nraum tso tawm inline.
<ul class="list-inline">
<li class="list-inline-item">This is a list item.</li>
<li class="list-inline-item">And another one.</li>
<li class="list-inline-item">But they're displayed inline.</li>
</ul>
Kev piav qhia daim ntawv teev kev sib raug zoo
Muab cov ntsiab lus thiab cov lus piav qhia kab rov tav los ntawm kev siv peb cov kab ke kab ke cov chav kawm ua ntej (lossis semantic mixins). Rau cov ntsiab lus ntev, koj tuaj yeem xaiv ntxiv ib .text-truncate
chav kawm los txiav cov ntawv nrog ellipsis.
- Cov npe piav qhia
- Daim ntawv teev lus piav qhia zoo meej rau kev txhais cov ntsiab lus.
- Lub sij hawm
-
Definition rau lub sij hawm.
Thiab ib co ntxiv placeholder txhais lus.
- Lwm lub sij hawm
- Cov ntsiab lus no luv luv, yog li tsis muaj kab lus ntxiv lossis dab tsi.
- Lub sij hawm truncated yog truncated
- Qhov no tuaj yeem pab tau thaum qhov chaw nruj. Ntxiv ib qho ellipsis thaum kawg.
- Zes
-
- Nested definition list
- Kuv hnov koj nyiam cov lus txhais. Cia kuv tso ib daim ntawv txhais lus hauv koj daim ntawv txhais lus.
<dl class="row">
<dt class="col-sm-3">Description lists</dt>
<dd class="col-sm-9">A description list is perfect for defining terms.</dd>
<dt class="col-sm-3">Term</dt>
<dd class="col-sm-9">
<p>Definition for the term.</p>
<p>And some more placeholder definition text.</p>
</dd>
<dt class="col-sm-3">Another term</dt>
<dd class="col-sm-9">This definition is short, so no extra paragraphs or anything.</dd>
<dt class="col-sm-3 text-truncate">Truncated term is truncated</dt>
<dd class="col-sm-9">This can be useful when space is tight. Adds an ellipsis at the end.</dd>
<dt class="col-sm-3">Nesting</dt>
<dd class="col-sm-9">
<dl class="row">
<dt class="col-sm-4">Nested definition list</dt>
<dd class="col-sm-8">I heard you like definition lists. Let me put a definition list inside your definition list.</dd>
</dl>
</dd>
</dl>
Teb font loj
Raws li ntawm v4.3.0, Bootstrap nkoj nrog cov kev xaiv los pab kom teb cov ntawv loj me, tso cai rau cov ntawv kom ntsuas ntau dua ib txwm nyob thoob plaws lub cuab yeej thiab qhov ntau thiab tsawg. RFS tuaj yeem qhib tau los ntawm kev hloov pauv $enable-responsive-font-sizes
Sass hloov pauv mus rau true
thiab rov ua dua Bootstrap.
Txhawm rau txhawb RFS , peb siv Sass mixin los hloov peb cov font-size
khoom qub. Teb qhov loj me ntawm font yuav muab tso ua ke rau hauv calc()
kev ua haujlwm nrog kev sib xyaw ua ke rem
thiab cov chaw saib xyuas kom ua tau raws li tus cwj pwm teb. Ntau ntxiv txog RFS thiab nws cov teeb tsa tuaj yeem pom ntawm nws qhov chaw cia GitHub .