HTML Marquees




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.

Sintassi

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>

Gli Attributi del Tag <marquee>

Qui di seguito verranno elencati alcuni attributi del tag <marquee>.

AttributoDescrizione
widthDefinisce la larghezza. Può essere un valore come 10 o 20% ecc.
heightDefinisce l' altezza. Può essere un valore come 10 o 20% ecc.
directionDefinisce la direzione in cui dovrà scorrere il testo. Può essere un valore come up, down, left o right.
behaviorDefinisce il tipo di scrolling del marquee. Può essere un valore come scroll, slide e alternate.
scrolldelayDefinisce quanto tempo deve passare fra uno scrolling e l' altro. Può essere un valore come 10 ecc.
scrollamountIndica la velocità dello scorrimento.Può essere un valore come 10 ecc.
loopIndica per quanto tempo dovrà scorrere il testo. Il valore di default è INFINITE, ossia che scorrerà all' infinito.
bgcolorDefinisce il colore di sfondo.
hspaceDefinisce lo spazio orizzontale intorno al marquee. Può essere un valore come 10 o 20% ecc.
vspaceDefinisce 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.

Esempio - 1

<!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:

This is basic example of marquee

Esempio - 2

<!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:

This example will take only 50% width

Esempio - 3

<!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:

This text will scroll from left to right

Esempio - 4

<!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:

This text will scroll from bottom to up
Advertisements