Bootstrap 4 Text/Typografie
Bootstrap 4-Standardeinstellungen
Bootstrap 4 verwendet einen Standardwert
font-size
von 16 Pixel und
line-height
ist 1,5.
Der Standardwert font-family
ist "Helvetica Neue", Helvetica, Arial, serifenlos.
Außerdem haben alle <p>
Elemente
margin-top: 0
und margin-bottom: 1rem
(standardmäßig 16 Pixel).
<h1> - <h6>
Bootstrap 4 formatiert HTML-Überschriften ( <h1>
bis
<h6>
) mit einer fetteren Schriftstärke und einer erhöhten Schriftgröße:
Beispiel
h1 Bootstrap heading (2.5rem = 40px)
h2 Bootstrap heading (2rem = 32px)
h3 Bootstrap heading (1.75rem = 28px)
h4 Bootstrap heading (1.5rem = 24px)
h5 Bootstrap heading (1.25rem = 20px)
h6 Bootstrap heading (1rem = 16px)
Überschriften anzeigen
Anzeigeüberschriften werden verwendet, um mehr als normale Überschriften hervorzuheben (größere Schriftgröße und geringere Schriftstärke), und es stehen vier Klassen zur Auswahl: .display-1
, .display-2
, .display-3
,.display-4
Beispiel
Display 1
Display 2
Display 3
Display 4
<klein>
In Bootstrap 4 wird das HTML <small>
-Element verwendet, um einen helleren Sekundärtext in jeder Überschrift zu erstellen:
Beispiel
h1 heading secondary text
h2 heading secondary text
h3 heading secondary text
h4 heading secondary text
h5 heading secondary text
h6 heading secondary text
<Markierung>
Bootstrap 4 gestaltet das HTML- <mark>
Element mit einer gelben Hintergrundfarbe und etwas Polsterung:
Beispiel
Use the mark element to highlight text.
<Abk.>
Bootstrap 4 formatiert das HTML- <abbr>
Element mit einem gepunkteten Rand unten:
Beispiel
The WHO was founded in 1948.
<Blockzitat>
Fügen Sie die .blockquote
Klasse zu einem hinzu, <blockquote>
wenn Sie Inhaltsblöcke aus einer anderen Quelle zitieren:
Beispiel
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 4 gestaltet das HTML- <dl>
Element folgendermaßen:
Beispiel
- Coffee
- - black hot drink
- Milk
- - white cold drink
<Code>
Bootstrap 4 gestaltet das HTML- <code>
Element folgendermaßen:
Beispiel
The following HTML elements: span
, section
, and div
defines a section in a document.
<kbd>
Bootstrap 4 gestaltet das HTML- <kbd>
Element folgendermaßen:
Beispiel
Use ctrl + p to open the Print dialog box.
<vor>
Bootstrap 4 gestaltet das HTML- <pre>
Element folgendermaßen:
Beispiel
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks.
Mehr Typografie-Klassen
Die folgenden Bootstrap 4-Klassen können hinzugefügt werden, um HTML-Elemente weiter zu stylen:
Class | Description | Example |
---|---|---|
.font-weight-bold |
Bold text | |
.font-weight-bolder |
Bolder text | |
.font-italic |
Italic text | |
.font-weight-light |
Light weight text | |
.font-weight-lighter |
Lighter weight text | |
.font-weight-normal |
Normal text | |
.lead |
Makes a paragraph stand out | |
.small |
Indicates smaller text (set to 80% of the size of the parent) | |
.text-left |
Indicates left-aligned text | |
.text-*-left |
Indicates left-aligned text on small, medium, large or xlarge screens | |
.text-break |
Prevents long text from breaking layout | |
.text-center |
Indicates center-aligned text | |
.text-*-center |
Indicates center-aligned text on small, medium, large or xlarge screens | |
.text-decoration-none |
Removes the underline from a link | |
.text-right |
Indicates right-aligned text | |
.text-*-right |
Indicates right-aligned text on small, medium, large or xlarge screens | |
.text-justify |
Indicates justified text | |
.text-monospace |
Monospaced text | |
.text-nowrap |
Indicates no wrap text | |
.text-lowercase |
Indicates lowercased text | |
.text-reset |
Resets the color of a text or a link (inherits the color from its parent) | |
.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 (used together with
.list-inline-item on each <li> elements) |
|
.pre-scrollable |
Makes a <pre> element scrollable |
Vollständige Bootstrap 4 CSS-Referenz
Eine vollständige Referenz aller in Bootstrap 4 verfügbaren CSS-Klassen finden Sie in unserer Bootstrap 4 All Classes Reference .