<pre>
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Sumario
El Elemento HTML <pre> (o Texto HTML Preformateado) representa texto preformateado. El texto en este elemento típicamente se muestra en una fuente fija, no proporcional, exactamente como es mostrado en el archivo. Los espacios dentro de este elemento también son mostrados como están escritos.
- Content categories Flow content, palpable content.
- Permitted content Phrasing content.
- Tag omission Ninguna, tanto la etiqueta inicial como la final son obligatorias.
- Permitted parent elements Any element that accepts flow content.
- DOM interface
HTMLPreElement
Atributos
Este elemento solo incluye los atributos globales.
Ejemplos
html
<!-- Un poco de codigo CSS -->
<pre>
body{
color: red;
}
a {
color:green;
}
</pre>
Resultado
body{ color: red; } a { color:green; }
Especificaciones
Specification |
---|
HTML # the-pre-element |
Compatibilidad con navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
pre | ||||||||||||
width | ||||||||||||
wrap |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
- Deprecated. Not for use in new websites.
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Véase también
- CSS:
white-space
,word-break