Tags HTML <h1> a <h6>


Exemplo

Os seis títulos HTML diferentes:

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>

Mais exemplos de "Experimente você mesmo" abaixo.


Definição e uso

As tags <h1>to <h6>são usadas para definir cabeçalhos HTML.

<h1>define o título mais importante. <h6>define o título menos importante.

Nota: Use apenas um <h1> por página - isso deve representar o título/assunto principal de toda a página. Além disso, não pule os níveis de título - comece com <h1>, depois use <h2>, e assim por diante.


Suporte ao navegador

Element
<h1> - <h6> Yes Yes Yes Yes Yes

Atributos Globais

As tags <h1>to <h6>também suportam os Atributos Globais em HTML .


Atributos do evento

As tags <h1>to <h6>também suportam os atributos de evento em HTML .



Mais exemplos

Exemplo

Defina a cor de fundo e a cor do texto dos títulos (com CSS):

<h1 style="background-color:DodgerBlue;">Hello World</h1>
<h2 style="color:Tomato;">Hello World</h2>

Exemplo

Defina o alinhamento dos títulos (com CSS):

<h1 style="text-align:center">This is heading 1</h1>
<h2 style="text-align:left">This is heading 2</h2>
<h3 style="text-align:right">This is heading 3</h3>
<h4 style="text-align:justify">This is heading 4</h4>

Páginas relacionadas

Tutorial HTML: Títulos HTML

Referência HTML DOM: objeto de título


Configurações padrão de CSS

A maioria dos navegadores exibirá o <h1>elemento com os seguintes valores padrão:

Exemplo

h1 {
  display: block;
  font-size: 2em;
  margin-top: 0.67em;
  margin-bottom: 0.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

A maioria dos navegadores exibirá o <h2>elemento com os seguintes valores padrão:

Exemplo

h2 {
  display: block;
  font-size: 1.5em;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

A maioria dos navegadores exibirá o <h3>elemento com os seguintes valores padrão:

Exemplo

h3 {
  display: block;
  font-size: 1.17em;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

A maioria dos navegadores exibirá o <h4>elemento com os seguintes valores padrão:

Exemplo

h4 {
  display: block;
  font-size: 1em;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

A maioria dos navegadores exibirá o <h5>elemento com os seguintes valores padrão:

Exemplo

h5 {
  display: block;
  font-size: .83em;
  margin-top: 1.67em;
  margin-bottom: 1.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

A maioria dos navegadores exibirá o <h6>elemento com os seguintes valores padrão:

Exemplo

h6 {
  display: block;
  font-size: .67em;
  margin-top: 2.33em;
  margin-bottom: 2.33em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}