
 
Un marquee HTML è una parte di testo che può scorrere sia in orizzontale che in verticale (in base a come viene impostato) lungo una pagina web. Viene creato utilizzando il tag HTML <marquees>.
Nota: Il tag HTML <marquee> non è più supportato da svariati browser perciò se ne sconsiglia l' utilizzo, al suo posto si può utilizzare Javascript e CSS per ottenere lo stesso effetto.
La sintassi più semplice per un tag <marquee> è la seguente:
<marquee attribute_name="attribute_value"....more attributes> One or more lines or text message or image </marquee>
Qui di seguito verranno elencati alcuni attributi del tag <marquee>.
| Attributo | Descrizione | 
|---|---|
| width | Definisce la larghezza. Può essere un valore come 10 o 20% ecc. | 
| height | Definisce l' altezza. Può essere un valore come 10 o 20% ecc. | 
| direction | Definisce la direzione in cui dovrà scorrere il testo. Può essere un valore come up, down, left o right. | 
| behavior | Definisce il tipo di scrolling del marquee. Può essere un valore come scroll, slide e alternate. | 
| scrolldelay | Definisce quanto tempo deve passare fra uno scrolling e l' altro. Può essere un valore come 10 ecc. | 
| scrollamount | Indica la velocità dello scorrimento.Può essere un valore come 10 ecc. | 
| loop | Indica per quanto tempo dovrà scorrere il testo. Il valore di default è INFINITE, ossia che scorrerà all' infinito. | 
| bgcolor | Definisce il colore di sfondo. | 
| hspace | Definisce lo spazio orizzontale intorno al marquee. Può essere un valore come 10 o 20% ecc. | 
| vspace | Definisce lo spazio verticale intorno al marquee. Può essere un valore come 10 o 20% ecc. | 
A seguire qualche esempio pratico di utilizzo del tag marquee.
<!DOCTYPE html> <html> <head> <title>HTML marquee Tag</title> </head> <body> <marquee>This is basic example of marquee</marquee> </body> </html>
Produrrà il seguente risultato:
<!DOCTYPE html> <html> <head> <title>HTML marquee Tag</title> </head> <body> <marquee width="50%">This example will take only 50% width</marquee> </body> </html>
Produrrà il seguente risultato:
<!DOCTYPE html> <html> <head> <title>HTML marquee Tag</title> </head> <body> <marquee direction="right">This text will scroll from left to right</marquee> </body> </html>
Produrrà il seguente risultato:
<!DOCTYPE html> <html> <head> <title>HTML marquee Tag</title> </head> <body> <marquee direction="up">This text will scroll from bottom to up</marquee> </body> </html>
Produrrà il seguente risultato: