---
title: "marquee"
author: "cetusz"
date: "2010-10-21T13:52:08Z"
tags: []
categories: ["Web前端"]
slug: "marquee"
draft: false
lastmod: "2010-10-21T13:52:08Z"
id: 790436
url: "https://cetus.iteye.com/blog/790436"
---

滚动文字Marquee属性及参数设置

滚动字幕Marquee代码大全

基本语法  
\-------------------------------------------  
&lt;marquee&gt;滚动文字 &lt;/marquee&gt;

文字移动属性的设置

方向

&lt;direction=#&gt; #=left, right,up,down &lt;marquee direction=left&gt;从右向左移！&lt;/marquee&gt;

方式

&lt;bihavior=#&gt; #=scroll, slide, alternate &lt;marquee behavior=scroll&gt;一圈一圈绕着走！&lt;/marquee&gt;  
&lt;marquee behavior=slide&gt;只走一次就歇了！&lt;/marquee&gt;  
&lt;marquee behavior=alternate&gt;来回走&lt;/marquee&gt;

循环

&lt;loop=#&gt; #=次数；若未指定则循环不止(infinite) &lt;marquee loop=3 width=50% behavior=scroll&gt;只走 3 趟&lt;/marquee&gt; &lt;P&gt;  
&lt;marquee loop=3 width=50% behavior=slide&gt;只走 3 趟&lt;/marquee&gt;  
&lt;marquee loop=3 width=50% behavior=alternate&gt;只走 3 趟！&lt;/marquee&gt;

速度

&lt;scrollamount=#&gt; &lt;marquee scrollamount=20&gt;啦啦啦，我走得好快哟！&lt;/marquee&gt;

延时

&lt;scrolldelay=#&gt; &lt;marquee scrolldelay=500 scrollamount=100&gt;啦啦啦，我走一步，停一停！&lt;/marquee&gt;

外观(Layout)设置

对齐方式(Align)

&lt;align=#&gt; #=top, middle, bottom &lt;font size=6&gt;  
&lt;marquee align=# width=400&gt;啦啦啦，我会移动耶！&lt;/marquee&gt;  
&lt;/font&gt;

底色

&lt;bgcolor=#&gt; #=rrggbb 16 进制数码，或者是下列预定义色彩：  
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,  
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua &lt;marquee bgcolor=aaaaee&gt;颜色！&lt;/marquee&gt;

面积

&lt;height=# width=#&gt; &lt;marquee height=40 width=50% bgcolor=aaeeaa&gt;面积！&lt;/marquee&gt; 　

空白

(Margins)&lt;hspace=# vspace=#&gt;  
&lt;marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle&gt;面积！&lt;/marquee&gt;

鼠标响应：即鼠标指向就停，离开继续.

onmouseover="this.stop()" onmouseout="this.start()"&gt;

例如：&lt;marquee direction=up scrollamount=2 onmouseover="this.stop();" onmouseout="this.start();" width=100 height=100&gt;中华人民共和国中华人民共和国&lt;br&gt;www.cnzz.cc中国站长网欢迎您&lt;br&gt;我学会了，哈哈哈&lt;/marquee&gt;