Bootstrap teks/tipografie


Bootstrap se verstek instellings

Bootstrap se wêreldwye versteklettertipegrootte is 14px, met 'n lynhoogte van 1,428.

Dit word toegepas op die <body>element en alle paragrawe ( <p>).

Daarbenewens het alle <p>elemente 'n onderste marge wat gelyk is aan die helfte van hul berekende lynhoogte (10 px by verstek).


Bootstrap vs. blaaier-standaarde

In hierdie hoofstuk sal ons kyk na 'n paar HTML-elemente wat 'n bietjie anders deur Bootstrap as blaaier verstek gestileer sal word.


<h1> - <h6>

By verstek sal Bootstrap die HTML-opskrifte ( <h1>na <h6>) op die volgende manier stileer:

Voorbeeld

h1 Bootstrap heading (36px)

h2 Bootstrap heading (30px)

h3 Bootstrap heading (24px)

h4 Bootstrap heading (18px)

h5 Bootstrap heading (14px)
h6 Bootstrap heading (12px)

<klein>

In Bootstrap word die HTML <small>-element gebruik om 'n ligter, sekondêre teks in enige opskrif te skep:

Voorbeeld

h1 heading secondary text

h2 heading secondary text

h3 heading secondary text

h4 heading secondary text

h5 heading secondary text
h6 heading secondary text


<merk>

Bootstrap sal die HTML- <mark>element op die volgende manier stileer:

Voorbeeld

Use the mark element to highlight text.


<abbr>

Bootstrap sal die HTML- <abbr>element op die volgende manier stileer:

Voorbeeld

The WHO was founded in 1948.


<blokaanhaling>

Bootstrap sal die HTML- <blockquote>element op die volgende manier stileer:

Voorbeeld

For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.

From WWF's website

Om die aanhaling aan die regterkant te wys, gebruik die .blockquote-reverseklas:

Voorbeeld

For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally.

From WWF's website

<dl>

Bootstrap sal die HTML- <dl>element op die volgende manier stileer:

Voorbeeld

Coffee
- black hot drink
Milk
- white cold drink

<kode>

Bootstrap sal die HTML- <code>element op die volgende manier stileer:

Voorbeeld

The following HTML elements: span, section, and div defines a section in a document.


<kbd>

Bootstrap sal die HTML- <kbd>element op die volgende manier stileer:

Voorbeeld

Use ctrl + p to open the Print dialog box.


<pre>

Bootstrap sal die HTML- <pre>element op die volgende manier stileer:

Voorbeeld

Text in a pre element
is displayed in a fixed-width
font, and it preserves
both      spaces and
line breaks.

Kontekstuele kleure en agtergronde

Bootstrap het ook 'n paar kontekstuele klasse wat gebruik kan word om "betekenis deur kleure" te gee.

Die klasse vir tekskleure is: .text-muted, .text-primary, .text-success, .text-info, .text-warning, en .text-danger:

Voorbeeld

This text is muted.

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

Die klasse vir agtergrondkleure is: .bg-primary, .bg-success, .bg-info, .bg-warning, en .bg-danger:

Voorbeeld

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.


Meer Tipografie Klasse

Die Bootstrap-klasse hieronder kan bygevoeg word om HTML-elemente verder te styl:

Class Description Example
.lead Makes a paragraph stand out
.small Indicates smaller text (set to 85% of the size of the parent)
.text-left Indicates left-aligned text
.text-center Indicates center-aligned text
.text-right Indicates right-aligned text
.text-justify Indicates justified text
.text-nowrap Indicates no wrap text
.text-lowercase Indicates lowercased text
.text-uppercase Indicates uppercased text
.text-capitalize Indicates capitalized text
.initialism Displays the text inside an <abbr> element in a slightly smaller font size
.list-unstyled Removes the default list-style and left margin on list items (works on both <ul> and <ol>). This class only applies to immediate children list items (to remove the default list-style from any nested lists, apply this class to any nested lists as well)
.list-inline Places all list items on a single line
.dl-horizontal Lines up the terms (<dt>) and descriptions (<dd>) in <dl> elements side-by-side. Starts off like default <dl>s, but when the browser window expands, it will line up side-by-side
.pre-scrollable Makes a <pre> element scrollable

Voltooi Bootstrap Tipografie Verwysing

Vir 'n volledige verwysing van alle tipografie-elemente/-klasse, gaan na ons volledige Bootstrap-tipografie-verwysing .

Kyk ook na ons Bootstrap Helper Classes Reference vir meer inligting oor kontekstuele klasse.