<pre>

Resumo

HTML texto preformatado (<pre>) é a tag utilizada para representar texto pré-formatado. Um texto dentro desse elemento é tipicamente exibido em uma fonte não proporcional da mesma maneira em que o texto original foi disposto no arquivo. Espaços em branco são mantidos no texto da mesma forma em que este foi digitado.

Content categories (en-US) Flow content (en-US), palpable content.

Atributos

Esse elemento apenas inclui atributos globais.

This element only includes the global attributes (en-US).

cols Non-standard

Contains the preferred count of characters that a line should have. It was a non-standard synonym of width. To achieve such an effect, use CSS styling instead.

width

Contains the preferred count of characters that a line should have. Though technically still implemented, this attribute has no visual effect; to achieve such an effect, use CSS styling instead.

wrap Non-standard

Is a hint indicating how the overflow must happen. In modern browser this hint is ignored and no visual effect results in its present; to achieve such an effect, use CSS styling instead.

Exemplos

html
<!-- Um exemplo de código css -->
<pre>
body {
  color:red;
}
</pre>

Resultado

body {
  color:red;
}

Especificações

Specification
HTML Standard
# the-pre-element

Compatibilidade de navegador

BCD tables only load in the browser

Veja mais