<marquee>文字列</marquee>
要素名 | 属性名 | 説明 | 非推奨 | 必須属性 |
---|---|---|---|---|
marquee | 文字列をスクロールさせる | |||
height | スクロール範囲の高さ(ピクセルまたは%で指定) | |||
width | スクロール範囲の幅(ピクセルまたは%で指定) | |||
hspace | 左右の余白(ピクセルで指定) | |||
vspace | 上下の余白(ピクセルで指定) | |||
behavior | スクロール動作の仕方 behavior="scroll" 一定方向にスクロールをくり返す behavior="alternate" 画面を往復する動作を繰り返す behavior="slide" スクロールの端まで来ると停止する | |||
direction | スクロール方向(leftまたはrightおよびupまたはdownで指定) | |||
loop | スクロール回数(デフォルトは無限) | |||
scrolldelay | 再描画までの時間の間隔(秒数で指定。値が大きいと遅く、値が小さいと速くなる。単位は1/1000秒、デフォルトはscrolldelay="85") | |||
scrollamount | 再描画までに進む距離(ピクセルで指定。値が大きいと速く、値が小さいと遅くなる。デフォルトはscrollamount="6") | |||
bgcolor | スクロール部分の背景色 |
marquee要素は、<marquee></marquee>で囲まれた範囲の文字列又は画像が、上下・左右にスクロールします。
デフォルトでは右から左へスクロールを繰り返しますが、 各属性の指定により、範囲・動作の回数・仕方・速度等を指定できます。
なお、marquee要素は、HTML4.01の規格外で、IEの独自仕様が、現在では一般的なプラウザが対応しています。(スクロールしないプラウザも有ります。)
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>文字列をスクロールさせる。</title>
</head>
<body text="black" bgcolor="#FFF8DC">
<marquee>デフォルトのスクロールです。</marquee>
<marquee direction="right" scrollamount="10" behavior="alternate">スクロールが往復します。</marquee>
<marquee direction="up" scrollamount="3" height="50px">下から上にスクロールします。</marquee>
<marquee direction="right" scrolldelay="30" truespeed bgcolor="red" height="20px">左から右にスクロールします。</marquee>
</body>
</html>
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>文字列をスクロールさせる。</title>
</head>
<body text="black" bgcolor="#FFF8DC">
<marquee>デフォルトのスクロールです。</marquee>
<marquee direction="right" scrollamount="10" behavior="alternate">スクロールが往復します。</marquee>
<marquee direction="up" scrollamount="3" height="50px">下から上にスクロールします。</marquee>
<marquee direction="right" scrolldelay="30" truespeed bgcolor="red" height="20px">左から右にスクロールします。</marquee>
</body>
</html>
表示例です
スクロールの速度を60未満にするには
スクロールの速度は、scrolldelay属性で60より小さな値を指定しても、60として処理されます。60未満の値で指定したい場合は、
truespeed属性を組み合わせて指定します。(<marquee scrolldelay="30" truespeed</marquee>)
文字列を点滅して表示する
blink要素は文字列を点滅表示させる事が出来ます。<blink></blink>の範囲に記述した文字列が点滅表示されます。
blink要素は、IEは非対応、Firefox, Opera等が対応しています。