Bootstrap Typography


Headings

All HTML headings, <h1> through <h6> , are available. .h1 through .h6 classes are also available, for when you want to match the font styling of a heading but still want your text to be displayed inline.

Example

<h1>h1. heading</h1>
<h2>h2. heading</h2>
<h3>h3. heading</h3>
<h4>h4. heading</h4>
<h5>h5. heading</h5>
<h6>h6. heading</h6>

h1. Bootstrap heading

h2. Bootstrap heading

h3. heading

h4. heading

h5. heading
h6. heading

Create lighter, secondary text in any heading with a generic <small> tag or the .small class.

<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<h2>h2. Bootstrap heading <small>Secondary text</small></h2>
<h3>h3. Bootstrap heading <small>Secondary text</small></h3>
<h4>h4. Bootstrap heading <small>Secondary text</small></h4>
<h5>h5. Bootstrap heading <small>Secondary text</small></h5>
<h6>h6. Bootstrap heading <small>Secondary text</small></h6>

h1. Bootstrap heading Secondary text

h2. Bootstrap heading Secondary text

h3. Bootstrap heading Secondary text

h4. Bootstrap heading Secondary text

h5. Bootstrap heading Secondary text
h6. Bootstrap heading Secondary text

Body copy

Bootstrap's global default font-size is 14px, with a line-height of 1.428. This is applied to the <body> and all paragraphs. In addition, <p> (paragraphs) receive a bottom margin of half their computed line-height (10px by default).

Example

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Lead body copy

Make a paragraph stand out by adding .lead.

Example

<p class="lead" >Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Built with Less

The typographic scale is based on two Less variables in variables.less: @font-size-base and @line-height-base. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.


Inline text elements

Marked text

For highlighting a run of text due to its relevance in another context, use the <mark> tag.

Example
You can use the mark tag to <mark>highlight</mark> text.
You can use the mark tag to highlight text.

Deleted text

For indicating blocks of text that have been deleted use the <del> tag.

Example
<mark>This line of text is meant to be treated as deleted text.</mark>
This line of text is meant to be treated as deleted text.

Strikethrough text

For indicating blocks of text that are no longer relevant use the <s> tag.

Example
<s>This line of text is meant to be treated as no longer accurate.</s>
This line of text is meant to be treated as no longer accurate.

Inserted text

For indicating additions to the document use the <ins> tag..

Example
<ins>This line of text is meant to be treated as an addition to the document.</ins>
This line of text is meant to be treated as an addition to the document.

Underlined text

To underline text use the <u> tag.

Example
<u>This line of text will render as underlined</u>
This line of text will render as underlined

Small text

For de-emphasizing inline or blocks of text, use the <small> tag to set text at 85% the size of the parent. Heading elements receive their own font-size for nested <small> elements.

You may alternatively use an inline element with .small in place of any <small>.

Example
<small>This line of text is meant to be treated as fine print.</small>
This line of text is meant to be treated as fine print.

Bold

For emphasizing a snippet of text with a heavier font-weight.

Example
The following snippet of text is rendered as <strong>bold text.</strong>
The following snippet of text is rendered as bold text.

Italics

For emphasizing a snippet of text with italics.

Example
The following snippet of text is rendered as <em>italicized text.</em>
The following snippet of text is rendered as italicized text.
 

Alternate elements

Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.


Alignment classes

Easily realign text to components with text alignment classes.

Example
<p class="text-left">Left aligned text.</p>
<p class="text-center">Center aligned text.</p>
<p class="text-right">Right aligned text.</p>
<p class="text-justify">Justified text.</p>
<p class="text-nowrap">No wrap text.</p>

Left aligned text.

Center aligned text.

Right aligned text.

Justified text.

No wrap text.


Transformation classes

Transform text in components with text capitalization classes.

Example
<p class="text-lowercase">Lowercased text.</p>
<p class="text-uppercase">Uppercased text.</p>
<p class="text-capitalize">Capitalized text.</p>

Lowercased text.

Uppercased text.

Capitalized text.


Abbreviations

Stylized implementation of HTML's <abbr> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a title attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover and to users of assistive technologies.

Basic abbreviation

Example
An abbreviation of the word attribute is <abbr title="attribute">attr.</abbr>
An abbreviation of the word attribute is attr.

Initialism

Add .initialism to an abbreviation for a slightly smaller font-size.

Example
<abbr title="HyperText Markup Language" class="initialism">HTML</abbr> is the best thing since sliced bread.
HTML is the best thing since sliced bread.

Addresses

Present contact information for the nearest ancestor or the entire body of work. Preserve formatting by ending all lines with <br>.

Example
<address>
<strong>Fastlearning </strong><br>
<abbr title="Phone">P:</abbr> (+91) 9646-20-6242
</address>

<address>
<strong>Sachin Yadab</strong><br>
<a href="mailto:[email protected]">[email protected]</a>
</address>
Fastlearning
P: (+91) 9646-20-6242
Sachin Yadab
[email protected]

Blockquotes

For quoting blocks of content from another source within your document.

Default blockquote

Wrap <blockquote> around any HTML as the quote. For straight quotes, we recommend a

Example
<blockquote>
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>
<blockquote>

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Blockquote options

Style and content changes for simple variations on a standard <blockquote>.

Naming a source

Add a <footer> for identifying the source. Wrap the name of the source work in cite>.

Example
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
  <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
<blockquote>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title

Alternate displays

Add .blockquote-reverse for a blockquote with right-aligned content.

Example
<blockquote class="blockquote-reverse">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
  <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
<blockquote>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title

Lists

Unordered

A list of items in which the order does not explicitly matter.

Example
<ul>
	<li>HTML</li>
	<li>CSS</li>
	<li>Java</li>
	<li>ASP</li>
	<li>More
		<ul>
			<li>Color</li>
			<li>SQL</li>
			<li>Bootstrap</li>
		</ul>
	</li>
	<li>About</li>
	<li>Example</li>
</ul>
  • HTML
  • CSS
  • Java
  • ASP
  • More
    • Color
    • SQL
    • Bootstrap
  • About
  • Example

Ordered

A list of items in which the order does explicitly matter.

Example
<ol>
	<li>HTML</li>
	<li>CSS</li>
	<li>Java</li>
	<li>ASP</li>
    <li>Color</li>
	<li>SQL</li>
	<li>Bootstrap</li>
</ol>
  1. HTML
  2. CSS
  3. Java
  4. ASP
  5. Color
  6. SQL
  7. Bootstrap

Unstyled

Remove the default list-style and left margin on list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well.

Example
<ul class="list-unstyled">
	<li>HTML</li>
	<li>CSS</li>
	<li>Java</li>
	<li>ASP</li>
	<li>More
		<ul>
			<li>Color</li>
			<li>SQL</li>
			<li>Bootstrap</li>
		</ul>
	</li>
	<li>About</li>
	<li>Example</li>
</ul>
  • HTML
  • CSS
  • Java
  • ASP
  • More
    • Color
    • SQL
    • Bootstrap
  • About
  • Example

Share this article on