Typography a wɔde kyerɛw nsɛm
Nwoma ne nhwɛsoɔ a ɛfa Bootstrap typography ho, a wiase nyinaa nhyehyɛɛ, nsɛmti, nipadua mu nsɛm, nsɛm a wɔahyehyɛ, ne nea ɛkeka ho ka ho.
Wiase nyinaa tebea horow
Bootstrap hyehyɛ wiase nyinaa nkyerɛkyerɛmu titiriw, typography, ne link styles. Sɛ ɛho hia sɛ wodi so pii a, hwɛ textual utility classes no .
- Fa native font stack a ɛpaw nea eye sen biara
font-family
ma OS ne mfiri biara di dwuma. - Sɛ wopɛ sɛ wonya type scale a ɛka ho na ɛyɛ mmerɛw a, yɛde browser no default root
font-size
(taa yɛ 16px) di dwuma sɛnea ɛbɛyɛ a nsrahwɛfo betumi ayɛ wɔn browser defaults no sɛnea ɛho hia. - Fa
$font-family-base
,$font-size-base
, ne$line-height-base
su ahorow no di dwuma sɛ yɛn nkyerɛwee nnyinaso a yɛde dii dwuma wɔ<body>
. - Set wiase nyinaa link kɔla via
$link-color
na fa link underlines nkutoo di dwuma wɔ:hover
. - Fa di dwuma
$body-bg
de hyehyɛ abackground-color
wɔ<body>
(#fff
default so).
Wobetumi ahu saa akwan yi wɔ mu _reboot.scss
, na wɔakyerɛkyerɛ wiase nyinaa nsakrae ahorow no mu wɔ _variables.scss
. Hwɛ hu sɛ wode besi $font-size-base
hɔ rem
.
Nsɛmti ahorow
HTML asɛmti nyinaa, <h1>
kosi <h6>
, wɔ hɔ.
Asɛmti | Nhwɛsoɔ |
---|---|
<h1></h1> |
h1. Bootstrap asɛmti no |
<h2></h2> |
h2. Bootstrap asɛmti no |
<h3></h3> |
h3. Bootstrap asɛmti no |
<h4></h4> |
h4. Bootstrap asɛmti no |
<h5></h5> |
h5. Bootstrap asɛmti no |
<h6></h6> |
h6. Bootstrap asɛmti no |
<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
through .h6
classes nso wɔ hɔ, ma bere a wopɛ sɛ wo ne font styling a ɛwɔ asɛmti bi mu no hyia nanso wuntumi mfa HTML element a ɛbata ho no nni dwuma.
h1. Bootstrap asɛmti no
h2. Bootstrap asɛmti no
h3. Bootstrap asɛmti no
h4. Bootstrap asɛmti no
h5. Bootstrap asɛmti no
h6. Bootstrap asɛmti no
<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>
Nsɛmti ahorow a wɔreyɛ no sɛnea wopɛ
Fa utility classes a ɛka ho no di dwuma fa san yɛ secondary heading text nketewa no fi Bootstrap 3 mu.
Fancy display heading Ne nsɛm a ɛto so abien a ayera
<h3>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h3>
Kyerɛ nsɛmti ahorow
Wɔayɛ atetesɛm asɛmti nneɛma no sɛnea ɛbɛyɛ a ɛbɛyɛ adwuma yiye wɔ wo krataafa no mu nsɛm no nam mu. Sɛ wuhia asɛmti bi na ama woada nsow a, susuw ho sɛ wode asɛmti a wɔde bɛkyerɛ —asɛmti kwan a ɛsõ a ɛwɔ adwene kakra bedi dwuma. Ma ɛntena w’adwenem sɛ saa nsɛmti yi ntumi nyɛ adwuma default so, nanso ɛyɛ yiye sɛ wobɛma font sizes a ɛyɛ adwuma no ayɛ adwuma .
Nkyerɛkyerɛmu 1 |
Nkyerɛkyerɛmu 2 |
Nkyerɛkyerɛmu 3 |
Nkyerɛkyerɛmu 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>
Di kan
Ma nkyekyem bi da nsow denam .lead
.
Eyi yɛ nkyekyem a edi kan. Ɛda nsow wɔ nkyekyem ahorow a wɔyɛ no daa no ho.
<p class="lead">
This is a lead paragraph. It stands out from regular paragraphs.
</p>
Nsɛm a ɛwɔ nkyerɛwde mu no mu nneɛma
Styling ma inline HTML5 nneɛma a wɔtaa de di dwuma.
Wubetumi de agyiraehyɛde tag no adi dwuma deda no adiatwerɛ.
Wɔayɛ sɛ wɔbɛfa saa nsɛm a wɔahyehyɛ yi sɛ nsɛm a wɔapopa.
Wɔayɛ sɛ wɔbɛfa saa nkyerɛwee yi sɛ ɛnyɛ nokware bio.
Wɔayɛ sɛ wɔbɛfa saa nsɛm a wɔahyehyɛ yi sɛ ade a wɔde aka krataa no ho.
Saa nsɛm yi bɛkyerɛ ase sɛnea wɔatwe adwene asi so no
Wɔayɛ sɛ wɔbɛfa saa nsɛm a wɔakyerɛw no sɛ nkyerɛwde a ɛyɛ fɛ.
Wɔakyerɛ saa nkyerɛwde yi ase sɛ nsɛm a ɛyɛ tuntum.
Saa nkyerɛwde yi a wɔakyerɛ ase sɛ nsɛm a wɔakyerɛw no italics.
<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
na .small
adesua ahorow nso wɔ hɔ a wɔde bedi dwuma wɔ ɔkwan koro no ara so sɛnea ɛte <mark>
ne <small>
bere a wɔrekwati nkyerɛase mu nkyerɛkyerɛmu biara a wɔmpɛ a tag ahorow no de bɛba no.
Bere a wɔankyerɛ wɔ atifi hɔ no, ntwentwɛn wo nan ase sɛ wode bedi dwuma <b>
na wode <i>
ahyɛ HTML5 mu. <b>
no kyerɛ sɛ ɛbɛtwe adwene asi nsɛmfua anaa nsɛmfua so a ɛrenkyerɛ hia foforo a ɛho hia bere a <i>
ɛyɛ nea ɛfa nne, mfiridwuma mu nsɛmfua, ne nea ɛkeka ho ho titiriw.
Nsɛm a wɔde kyerɛw nsɛm
Sesa nsɛm a wɔahyehyɛ no pɛpɛɛpɛ, dannan, ɔkwan a wɔfa so yɛ ade, emu duru, ne kɔla denam yɛn nkyerɛwee mfaso ne kɔla mfaso horow so .
Nsɛmfua a wɔatwa no tiaa
Stylized implementation of HTML's <abbr>
element ma abbreviations ne acronyms de kyerɛ nkyerɛase a wɔatrɛw mu no wɔ hover so. Abbreviations wɔ default underline na wonya mmoa cursor de ma nsɛm foforo wɔ hover ne wɔn a wɔde mmoa mfiridwuma di dwuma.
Fa ka .initialism
asɛmfua tiawa bi ho ma font-size a ɛyɛ ketewaa bi.
attr
HTML a wɔde di dwuma
<p><abbr title="attribute">attr</abbr></p>
<p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr></p>
Nsɛm a wɔde siw ano
Sɛ wopɛ sɛ wofa nsɛm a wɔabɔ no mua a efi baabi foforo a ɛwɔ wo krataa no mu a. Fa HTML<blockquote class="blockquote">
biara kyekyere ho sɛ nea wɔafa aka no.
Asɛm a wɔafa aka a wonim no yiye, a ɛwɔ blockquote element bi mu.
<blockquote class="blockquote">
<p class="mb-0">A well-known quote, contained in a blockquote element.</p>
</blockquote>
Fibea bi din a wɔbɛbɔ
Fa a <footer class="blockquote-footer">
ma wohu baabi a wonya fi no ka ho. Fa fibea adwuma no din kyekyere <cite>
.
Asɛm a wɔafa aka a wonim no yiye, a ɛwɔ blockquote element bi mu.
<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>
Nneɛma a Wɔde Di Dwuma
Fa text utilities di dwuma sɛnea ɛho hia na sesa alignment a ɛwɔ wo blockquote no mu.
Asɛm a wɔafa aka a wonim no yiye, a ɛwɔ blockquote element bi mu.
<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>
Asɛm a wɔafa aka a wonim no yiye, a ɛwɔ blockquote element bi mu.
<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>
Nsɛm a wɔahyehyɛ
Wɔannwene no
Yi default list-style
ne benkum margin wɔ list nneɛma (mmofra ntɛm ara nkutoo). Eyi fa mmofra a wɔakyerɛw wɔn din ntɛm ara nneɛma nkutoo ho , a ɛkyerɛ sɛ ɛho behia sɛ wode adesuakuw no ka ho ma nkyerɛwde biara a wɔde ahyɛ mu nso.
- Eyi yɛ nsɛm a wɔahyehyɛ.
- Ɛte sɛ nea wɔankyerɛw no koraa.
- Structurally, ɛda so ara yɛ list.
- Nanso, saa ɔkwan yi fa abofra nneɛma a ɛwɔ hɔ ntɛm ara nkutoo ho.
- Nsɛm a wɔahyehyɛ a wɔde ahyɛ mu:
- no nnya saa ɔkwan yi so nkɛntɛnso
- bɛda so ara akyerɛ tuo bi
- na wɔwɔ benkum so fã a ɛfata
- Ebia eyi da so ara yɛ nea mfaso wɔ so wɔ tebea horow bi mu.
<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>
Inline no mu
Yi list bi mu atuo no na fa kanea bi gu so margin
denam adesuakuw abien a wɔaka abom so, .list-inline
ne .list-inline-item
.
- Eyi yɛ ade a wɔahyehyɛ.
- Na ɔfoforo nso.
- Nanso wɔda no adi wɔ inline mu.
<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>
Nkyerɛkyerɛmu list alignment
Fa nsɛmfua ne nkyerɛkyerɛmu ahorow no hyia wɔ ɔkwan a ɛkɔ soro so denam yɛn grid nhyehyɛe no adesua ahorow a wɔadi kan akyerɛkyerɛ mu (anaasɛ nkyerɛase mixins) a wode bedi dwuma no so. Sɛ wopɛ nsɛm tenten a, wubetumi de .text-truncate
adesuakuw bi aka ho a wode ellipsis atwa nkyerɛwee no mu.
- Nkyerɛkyerɛmu a wɔahyehyɛ
- Nkyerɛkyerɛmu a wɔahyehyɛ no yɛ pɛpɛɛpɛ ma nsɛmfua nkyerɛase.
- Asɛmfua
-
Nkyerɛase a wɔde ma asɛmfua no.
Na ebinom foforo nso placeholder nkyerɛase nkyerɛwee.
- Asɛmfua foforo
- Saa nkyerɛase yi yɛ tiawa, enti nkyekyɛm foforo anaa biribiara nni hɔ.
- Wɔatwa asɛmfua a wɔatwa no tiaa no mu
- Eyi betumi ayɛ nea mfaso wɔ so bere a baabi a ɛwɔ hɔ no yɛ den no. Ɔde ellipsis bi ka ho wɔ awiei.
- Nesting a wɔde yɛ buw
-
- Nested nkyerɛase list
- Metee sɛ wopɛ definition lists. Ma memfa nkyerɛaseɛ list bi nhyɛ wo nkyerɛaseɛ list no mu.
<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>
Font akɛse a ɛyɛ mmuae
Ɛde besi v4.3.0 no, Bootstrap de po so hyɛn a ɛwɔ hokwan sɛ ɛbɛma font akɛse a ɛyɛ mmuae no ayɛ adwuma, na ɛma nsɛm no tumi susuw adebɔ mu kɛse wɔ mfiri ne viewport akɛse mu. Wobetumi ama RFS ayɛ adwuma denam $enable-responsive-font-sizes
Sass variable no a wobɛsesa akɔ true
ne Bootstrap a wobɛsan aboaboa ano no so.
Sɛ yɛbɛboa RFS a, yɛde Sass mixin di dwuma de si yɛn font-size
agyapadeɛ a ɛyɛ daa no ananmu. Wɔbɛboaboa font akɛseɛ a ɛyɛ mmuaeɛ ano ayɛ no calc()
dwumadie a ɛwɔ afrafra rem
ne viewport units na ama mmuaeɛ scaling suban no atumi ayɛ adwuma. Wobetumi ahu RFS ne ne nhyehyeɛ ho nsɛm pii wɔ ne GitHub adekorabea .