Il tag HTML <pre>



Descrizione

Il tag HTML <pre> viene utilizzato per indicare un testo preformattato.

I browser normalmente mostrano il testo con un font monospaziato, con la spaziatura intatta e senza tagliare le parole.

Esempio

<!DOCTYPE html>
<html>
<head>
<title>HTML pre Tag</title>
</head>
<body>
<pre>
      This text is
 in a fixed-pitch
        font, and it preserves
 both    spaces and line breaks
</pre>
</body>
</html>

Produrrà il seguente risultato:

      This text is
 in a fixed-pitch
        font, and it preserves
 both    spaces and line breaks

Attributi Globali

Questo tag supporta tutti gli attributi globali descritti in - HTML - Referenze Attributi

Attributi Specifici

The HTML <pre> supporta anche i seguenti attributi aggiuntivi:

AttributoValoreDescrizione
widthnumericoDeprecated: Definisce la larghezza desiderata per il testo pre-formattato.

Attributi Evento

Questo tag supporta tutti gli attributi evento descritti in - HTML - Referenze Eventi

Compatibilità Browser

ChromeFirefoxIEOperaSafariAndroid
SiSiSiSiSiSi
html_tags_reference.htm
Advertisements