Texto/Tipografia Bootstrap


Configurações padrão do Bootstrap

O tamanho da fonte padrão global do Bootstrap é 14px, com uma altura de linha de 1,428.

Isso é aplicado ao <body>elemento e a todos os parágrafos ( <p>).

Além disso, todos os <p>elementos têm uma margem inferior que equivale à metade da altura da linha calculada (10px por padrão).


Bootstrap vs. Padrões do navegador

Neste capítulo, veremos alguns elementos HTML que serão estilizados um pouco diferente pelo Bootstrap dos padrões do navegador.


<h1> - <h6>

Por padrão, o Bootstrap estilizará os títulos HTML ( <h1>a <h6>) da seguinte maneira:

Exemplo

h1 Bootstrap heading (36px)

h2 Bootstrap heading (30px)

h3 Bootstrap heading (24px)

h4 Bootstrap heading (18px)

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

<pequeno>

No Bootstrap, o <small>elemento HTML é usado para criar um texto secundário mais leve em qualquer título:

Exemplo

h1 heading secondary text

h2 heading secondary text

h3 heading secondary text

h4 heading secondary text

h5 heading secondary text
h6 heading secondary text


<marca>

O Bootstrap estilizará o <mark>elemento HTML da seguinte maneira:

Exemplo

Use the mark element to highlight text.


<abr>

O Bootstrap estilizará o <abbr>elemento HTML da seguinte maneira:

Exemplo

The WHO was founded in 1948.


<blockquote>

O Bootstrap estilizará o <blockquote>elemento HTML da seguinte maneira:

Exemplo

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

Para mostrar a citação à direita, use a .blockquote-reverseclasse:

Exemplo

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>

O Bootstrap estilizará o <dl>elemento HTML da seguinte maneira:

Exemplo

Coffee
- black hot drink
Milk
- white cold drink

<código>

O Bootstrap estilizará o <code>elemento HTML da seguinte maneira:

Exemplo

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


<kbd>

O Bootstrap estilizará o <kbd>elemento HTML da seguinte maneira:

Exemplo

Use ctrl + p to open the Print dialog box.


<pré>

O Bootstrap estilizará o <pre>elemento HTML da seguinte maneira:

Exemplo

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

Cores e fundos contextuais

O Bootstrap também possui algumas classes contextuais que podem ser usadas para fornecer "significado através das cores".

As classes para cores de texto são: .text-muted, .text-primary, .text-success, .text-info, .text-warninge .text-danger:

Exemplo

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.

As classes para cores de fundo são: .bg-primary, .bg-success, .bg-info, .bg-warninge .bg-danger:

Exemplo

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.


Mais aulas de tipografia

As classes de Bootstrap abaixo podem ser adicionadas para estilizar ainda mais os elementos HTML:

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

Referência Completa de Tipografia Bootstrap

Para uma referência completa de todos os elementos/classes de tipografia, acesse nossa Referência de Tipografia Bootstrap completa .

Veja também nosso Bootstrap Helper Classes Reference para obter mais informações sobre classes contextuais.