Taypografi
Dokumɛnt ɛn ɛgzampul dɛn fɔ Bootstrap taypografi, inklud di glob ɔl sɛtin dɛn, ɛd dɛn, bɔdi tɛks, list dɛn, ɛn ɔda tin dɛn.
Di wɔl sɛtin dɛn
Bootstrap de sɛt di bɛsis glob ɔl displei, taypografi, ɛn link stayl dɛn. We yu nid mɔ kɔntrol, chɛk di tɛkstual yutiliti klas dɛn .
- Yuz wan nativ font stak we de pik di bɛst
font-family
fɔ ɛni OS ɛn divays. - Fɔ mek yu gɛt mɔ inkluziv ɛn aksesbul tayp skel, wi de yuz di brawza in difɔlt rut
font-size
(tipikli 16px) so dat di wan dɛn we de kam kin kɔstɔmayz dɛn brɔwza difɔlt dɛn as nid de. - Yuz di
$font-family-base
,$font-size-base
, ɛn$line-height-base
atribyut dɛn as wi taypografik bays we dɛn yuz fɔ di<body>
. - Set di global link kala via
$link-color
ɛn aplay link ɔndalayn dɛn nɔmɔ pan:hover
. - Yuz
$body-bg
fɔ sɛt abackground-color
pan di<body>
(#fff
bay difɔlt).
Yu kin fɛn dɛn stayl ya insay _reboot.scss
, ɛn di glob ɔl vɛriɔbul dɛn de difayn insay _variables.scss
. Mek shɔ se yu sɛt $font-size-base
insay rem
.
Di edlayn dɛn
Ɔl di HTML edlayn dɛn, <h1>
te to <h6>
, de.
Di edlayn | Ɛgzampul |
---|---|
<h1></h1> |
h1. Bootstrap we de na di ed |
<h2></h2> |
h2. Bootstrap we de na di ed |
<h3></h3> |
h3. Bootstrap we de na di ed |
<h4></h4> |
h4. Bootstrap we de na di ed |
<h5></h5> |
h5. Bootstrap we de na di ed |
<h6></h6> |
h6. Bootstrap we de na di ed |
<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
tru .h6
klas dɛn de bak, fɔ we yu want fɔ mach di font stayl fɔ wan ɛd bɔt yu nɔ ebul fɔ yuz di HTML ɛlimɛnt we gɛt fɔ du wit am.
h1. Bootstrap we de na di ed
h2. Bootstrap we de na di ed
h3. Bootstrap we de na di ed
h4. Bootstrap we de na di ed
h5. Bootstrap we de na di ed
h6. Bootstrap we de na di ed
<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>
Fɔ kɔstɔmayt di edlayn dɛn
Yuz di yutiliti klas dɛn we de insay fɔ mek di smɔl sɛkɔndari ɛd tɛks bak frɔm Bootstrap 3.
Fancy display heading Wit sɛkɔndari tɛks we dɔn fad
<h3>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h3>
Sho di edlayn dɛn
Dɛn mek tradishɔnal edlayn ɛlimɛnt dɛn fɔ wok fayn fayn wan na di mit we de na yu pej kɔntinyu. We yu nid edlayn fɔ mek i difrɛn, tink bɔt fɔ yuz displei edlayn —we na big edlayn stayl we gɛt smɔl mɔ opinion. Yu fɔ mɛmba se dɛn edlayn dɛn ya nɔ de ansa bay difɔlt, bɔt i pɔsibul fɔ mek yu ebul fɔ yuz di font saiz dɛn we de ansa .
Displei we de sho 1 |
Displei we de sho 2 |
Displei we de sho 3 |
Displei we de sho 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>
Lid
Mek wan paregraf difrɛn bay we yu ad .lead
.
Dis na paregraf we de bifo. I difrɛn frɔm paregraf dɛn we dɛn kin yuz ɔltɛm.
<p class="lead">
This is a lead paragraph. It stands out from regular paragraphs.
</p>
Inlayn tɛks ɛlimɛnt dɛn
Stayl fɔ kɔmɔn inlayn HTML5 ɛlimɛnt dɛn.
Yu kin yuz di mak tag fɔshotɛks.
Dis layn fɔ tɛks min fɔ trit am lɛk tɛks we dɛn dɔn dilit.
Dɛn min fɔ trit dis layn na di tɛks as sɔntin we nɔ kɔrɛkt igen.
Dis layn fɔ di tɛks min fɔ trit am as sɔntin we dɛn ad to di dɔkyumɛnt.
Dis layn fɔ di tɛks go rɛnd lɛk aw dɛn ɔndalayn am
Dis layn fɔ di tɛks dɛn min fɔ trit am lɛk fayn print.
Dis layn we dɛn rɛnd lɛk bold tɛks.
Dis layn we dɛn rɛnd lɛk tɛks we dɛn rayt italiks.
<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
ɛn .small
klas dɛn de bak fɔ yuz di sem stayl dɛn we dɛn de yuz <mark>
ɛn <small>
we dɛn de avɔyd ɛni sɛmantik implikashɔn we dɛn nɔ want we di tɛg dɛn go briŋ.
Pan ɔl we dɛn nɔ sho am ɔp, fil fri fɔ yuz <b>
ɛn <i>
insay HTML5. <b>
na fɔ aylayt wɔd ɔ frɛz dɛn we nɔ de gi ɔda impɔtants we <i>
na fɔ vɔys, tɛknikal wɔd dɛn, ɛn ɔda tin dɛn.
Tekst yutiliti dɛn
Chenj tɛks alaynɛshɔn, transfɔm, stayl, wet, ɛn kɔlɔ wit wi tɛks yutiliti ɛn kɔlɔ yutiliti .
Di tin dɛn we dɛn kin yuz fɔ shɔt
Stylized implimentishɔn fɔ HTML in <abbr>
ɛlimɛnt fɔ abrevieshɔn ɛn akɔdin fɔ sho di ɛkspanda vɛshɔn pan hova. Abbrevieshɔn dɛn gɛt difɔlt ɔndalayn ɛn dɛn gɛt ɛp kɔsa fɔ gi ɔda kɔntɛks pan hova ɛn to di wan dɛn we de yuz ɛp tɛknɔlɔji dɛn.
Ad .initialism
to wan shɔt fɔ wan smɔl font-sayz.
attr
HTML
<p><abbr title="attribute">attr</abbr></p>
<p><abbr title="HyperText Markup Language" class="initialism">HTML</abbr></p>
Blɔkkɔt dɛn
Fɔ kot blɔk dɛn fɔ kɔntinyu frɔm ɔda sɔs insay yu dɔkyumɛnt. Rap <blockquote class="blockquote">
rawnd ɛni HTML as di kot.
Wan kot we bɔku pipul dɛn sabi, we de insay wan blɔkkɔt ɛlimɛnt.
<blockquote class="blockquote">
<p class="mb-0">A well-known quote, contained in a blockquote element.</p>
</blockquote>
Fɔ gi nem to wan sɔs
Ad wan <footer class="blockquote-footer">
fɔ no di say we dɛn pul am. Rap di nem fɔ di sɔs wok insay <cite>
.
Wan kot we bɔku pipul dɛn sabi, we de insay wan blɔkkɔt ɛlimɛnt.
<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>
Alignmɛnt fɔ di wan dɛn we de
Yuz tɛks yutiliti dɛn as nid de fɔ chenj di alaynɛshɔn fɔ yu blɔkkɔt.
Wan kot we bɔku pipul dɛn sabi, we de insay wan blɔkkɔt ɛlimɛnt.
<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>
Wan kot we bɔku pipul dɛn sabi, we de insay wan blɔkkɔt ɛlimɛnt.
<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>
List dɛn
Nɔ stayl
Rimov di difɔlt list-style
ɛn lɛft margin na di list aytem dɛn (pikin dɛn nɔmɔ). Dis de onli aplay to immediate pikin list items , we min se yu go nid fɔ ad di klas fɔ ɛni nest list bak.
- Dis na wan list.
- I tan lɛk se dɛn nɔ stayl am atɔl.
- Structurally, i stil bi wan list.
- Bɔt dis stayl de jɔs aplay to di pikin ɛlimɛnt dɛn we de wantɛm wantɛm.
- List dɛn we dɛn dɔn nɛst:
- nɔ de afɛkt dis stayl
- go stil sho wan bulɛt
- ɛn gɛt di rayt lɛft margin
- Dis kin stil fayn fɔ sɔm tin dɛn.
<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>
Inlayn
Rimov wan list in bulɛt ɛn put sɔm layt margin
wit wan kɔmbaynshɔn fɔ tu klas dɛn, .list-inline
ɛn .list-inline-item
.
- Dis na wan tin we de na di list.
- Ɛn wan ɔda wan.
- Bɔt dɛn de sho dɛn insay layn.
<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>
Diskripshɔn list alaynɛshɔn
Align tɛm ɛn diskripshɔn dɛn ɔrizɔntal wan bay we yu yuz wi grid sistɛm in prɛdifayn klas dɛn (ɔ sɛmantik miksin dɛn). Fɔ lɔng tɛm, yu kin opshɔnali ad wan .text-truncate
klas fɔ trunkat di tɛks wit ɛlipsis.
- Diskripshɔn list dɛn
- Wan diskripshɔn list fayn fɔ difayn wɔd dɛn.
- Wɔd
-
Difinishɔn fɔ di wɔd.
Ɛn sɔm mɔ pleshɔlda difinishɔn tɛks.
- Wan ɔda wɔd
- Dis difinishɔn shɔt, so nɔ ɛkstra paregraf ɔ ɛnitin.
- Truncated term na trunkated
- Dis kin fayn we di ples nɔ bɔku. Ad wan ɛlipsis na di ɛnd.
- Fɔ mek dɛn nɛst
-
- Nested difinishɔn list
- A yɛri yu lɛk difinishɔn list dɛn. Mek a put wan difinishɔn list insay yu difinishɔn list.
<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>
Fɔnt saiz dɛn we de ansa
As of v4.3.0, Bootstrap ship wit di opshɔn fɔ ɛnabul rispɔnsiv font saiz dɛn, we de alaw tɛks fɔ skel mɔ natura wan akɔdin to divays ɛn viupɔt saiz dɛn. RFS kin ɛnabul bay we yu chenj di $enable-responsive-font-sizes
Sass vɛriɔbul to true
ɛn rikompayl Bootstrap.
Fɔ sɔpɔt RFS , wi de yuz wan Sass mixin fɔ riples wi nɔmal font-size
prɔpati dɛn. Rispɔnsiv font saiz dɛn go kɔmpilayt insay calc()
fɛnshɔn dɛn wit wan miks rem
ɛn viupɔt yunit dɛn fɔ mek di rispɔnsiv skel bihayvya. Yu kin fɛn mɔ bɔt RFS ɛn in kɔnfigyushɔn na in GitHub ripɔsitɔri .