Bootstrap Text/Typography Bootstrap’s Default Settings In this chapter, we will look at some HTML elements that will be styled a little bit differently by Bootstrap than browser defaults.

Example

h1 Bootstrap heading (36px)

h2 Bootstrap heading (30px)

h3 Bootstrap heading (24px)

h4 Bootstrap heading (18px)

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

 

<body>


<div class="container">

<h1>h1 Bootstrap heading (36px)</h1>


<h2>h2 Bootstrap heading (30px)</h2>


<h3>h3 Bootstrap heading (24px)</h3>


<h4>h4 Bootstrap heading (18px)</h4>


<h5>h5 Bootstrap heading (14px)</h5>


<h6>h6 Bootstrap heading (12px)</h6>

</div>


</body>

<small>

In Bootstrap the HTML <small> element is used to create a lighter, secondary text in any heading:

h1 heading secondary text

h2 heading secondary text

h3 heading secondary text

h4 heading secondary text

h5 heading secondary text
h6 heading secondary text
<body>

<div class="container">
  <h1>Lighter, Secondary Text</h1>
  <p>The small element is used to create a lighter, secondary text in any heading:</p>
  <h1>h1 heading <small>secondary text</small></h1>
  <h2>h2 heading <small>secondary text</small></h2>
  <h3>h3 heading <small>secondary text</small></h3>
  <h4>h4 heading <small>secondary text</small></h4>
  <h5>h5 heading <small>secondary text</small></h5>
  <h6>h6 heading <small>secondary text</small></h6>
</div>

</body>


Bootstrap will style the HTML element in the following way:
Example
Use the mark element to highlight text.

<body>

<div class="container">
  <h1>Highlight Text</h1>
  <p>Use the mark element to <mark>highlight</mark> text.</p>
</div>

</body>


Bootstrap will style the HTML element in the following way:
Example
The WHO was founded in 1948.

<body>

<div class="container">
  <h1>Abbreviations</h1>
  <p>The abbr element is used to mark up an abbreviation or acronym:</p>
  <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>
</div>

</body>

To show the quote on the right, use the .blockquote-reverse class:
Example
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.

<body>

<div class="container">
  <h1>Blockquotes</h1>
  <p>To show the quote on the right use the class .blockquote-reverse:</p>
  <blockquote class="blockquote-reverse">
    <p>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.</p>
    <footer>From WWF's website</footer>
  </blockquote>
</div>
Bootstrap will style the HTML
element in the following way:

Example
Coffee
– black hot drink
Milk
– white cold drink

<body>

<div class="container">
  <h1>Description Lists</h1>
  <p>The dl element indicates a description list:</p>
  <dl>
    <dt>Coffee</dt>
    <dd>- black hot drink</dd>
    <dt>Milk</dt>
    <dd>- white cold drink</dd>
  </dl>
</div>


Bootstrap will style the HTML element in the following way:

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

<body>

<div class="container">
  <h1>Code Snippets</h1>
  <p>Inline snippets of code should be embedded in the code element:</p>
  <p>The following HTML elements: <code>span</code>, <code>section</code>, and <code>div</code> defines a section in a document.</p>
</div>

</body>


Bootstrap will style the HTML element in the following way:

Example
Use ctrl + p to open the Print dialog box.

<body>

<div class="container">
  <h1>Keyboard Inputs</h1>
  <p>To indicate input that is typically entered via the keyboard, use the kbd element:</p>
  <p>Use <kbd>ctrl + p</kbd> to open the Print dialog box.</p>
</div>

</body>
Bootstrap will style the HTML 
 element in the following way:

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

<div class="container">
<h1>Multiple Code Lines</h1>
<p>For multiple lines of code, use the pre element:</p>
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both      spaces and
line breaks.
</pre>
</div>

</body>

Contextual Colors and Backgrounds
Bootstrap also has some contextual classes that can be used to provide "meaning through colors".

The classes for text colors are:.text-muted, .text-primary, .text-success, .text-info, .text-warning, and .text-danger:

Example
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.

<body>

<div class="container">
  <h2>Contextual Colors</h2>
  <p>Use the contextual classes to provide "meaning through colors":</p>
  <p class="text-muted">This text is muted.</p>
  <p class="text-primary">This text is important.</p>
  <p class="text-success">This text indicates success.</p>
  <p class="text-info">This text represents some information.</p>
  <p class="text-warning">This text represents a warning.</p>
  <p class="text-danger">This text represents danger.</p>
</div>

</body>

The classes for background colors are:.bg-primary, .bg-success, bg-info, bg-warning, and .bg-danger:

Example
This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

<body>

<div class="container">
  <h2>Contextual Backgrounds</h2>
  <p>Use the contextual background classes to provide "meaning through colors":</p>
  <p class="bg-primary">This text is important.</p>
  <p class="bg-success">This text indicates success.</p>
  <p class="bg-info">This text represents some information.</p>
  <p class="bg-warning">This text represents a warning.</p>
  <p class="bg-danger">This text represents danger.</p>
</div>

</body>