Bootstrap- tekst/typografie
De standaardinstellingen van Bootstrap
De algemene standaardlettergrootte van Bootstrap is 14px, met een regelhoogte van 1.428.
Dit wordt toegepast op het <body>
element en alle alinea's ( <p>
).
Bovendien hebben alle <p>
elementen een ondermarge die gelijk is aan de helft van hun berekende regelhoogte (standaard 10px).
Bootstrap versus standaard browserinstellingen
In dit hoofdstuk zullen we kijken naar enkele HTML-elementen die door Bootstrap iets anders worden gestileerd dan de standaardinstellingen van de browser.
<h1> - <h6>
Standaard zal Bootstrap de HTML-koppen ( <h1>
tot
<h6>
) op de volgende manier opmaken:
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 <small>
wordt het HTML-element gebruikt om een lichtere, secundaire tekst in een kop te maken:
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
<mark>
Bootstrap zal het HTML- <mark>
element op de volgende manier opmaken:
Voorbeeld
Use the mark element to highlight text.
<afkorting>
Bootstrap zal het HTML- <abbr>
element op de volgende manier opmaken:
Voorbeeld
The WHO was founded in 1948.
<blokquote>
Bootstrap zal het HTML- <blockquote>
element op de volgende manier opmaken:
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.
Gebruik de .blockquote-reverse
klasse om het citaat aan de rechterkant weer te geven:
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.
<dl>
Bootstrap zal het HTML- <dl>
element op de volgende manier opmaken:
Voorbeeld
- Coffee
- - black hot drink
- Milk
- - white cold drink
<code>
Bootstrap zal het HTML- <code>
element op de volgende manier opmaken:
Voorbeeld
The following HTML elements: span
, section
, and div
defines a section in a document.
<kbd>
Bootstrap zal het HTML- <kbd>
element op de volgende manier opmaken:
Voorbeeld
Use ctrl + p to open the Print dialog box.
<pre>
Bootstrap zal het HTML- <pre>
element op de volgende manier opmaken:
Voorbeeld
Text in a pre element is displayed in a fixed-width font, and it preserves both spaces and line breaks.
Contextuele kleuren en achtergronden
Bootstrap heeft ook enkele contextuele klassen die kunnen worden gebruikt om "betekenis door kleuren" te geven.
De klassen voor tekstkleuren zijn: .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.
De klassen voor achtergrondkleuren zijn: .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 typografielessen
De Bootstrap-klassen hieronder kunnen worden toegevoegd om HTML-elementen verder op te maken:
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 |
Volledige Bootstrap Typografie Referentie
Voor een volledige referentie van alle typografische elementen/klassen, ga naar onze volledige Bootstrap Typography Reference .
Bekijk ook onze Bootstrap Helper Classes Reference voor meer informatie over contextuele klassen.