<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.
- Conteúdo permitido Phrasing content (en-US).
- Tag omission None, both the starting and ending tag are mandatory.
- Elementos pai permitidos Any element that accepts flow content (en-US).
- interface DOM
HTMLPreElement
(en-US)
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
Especificação | Status | Comentário |
---|---|---|
HTML Living Standard The definition of '<pre>' in that specification. |
Padrão em tempo real | Nenhuma mudança significante na HTML Living Standard |
HTML5 The definition of '<pre>' in that specification. |
Recomendação | Nenhuma mudança significante na HTML 4.01 Specification |
HTML 4.01 Specification The definition of '<dl>' in that specification. |
Recomendação | Atributto cols obsoleto |
Compatibilidade de navegador
BCD tables only load in the browser
Veja mais
- CSS:
white-space
,word-break