<marquee>:选框元素
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
<marquee> HTML 元素用于插入文本滚动区域。你可以使用其属性控制文本到达其内容区域边缘时发生的情况。
¥The <marquee> HTML element is used to insert a scrolling area of text. You can control what happens when the text reaches the edges of its content area using its attributes.
属性
¥Attributes
behaviorDeprecated-
设置文本在选取框内滚动的方式。可能的值为
scroll、slide和alternate。如果未指定值,则默认值为scroll。 bgcolorDeprecated-
通过颜色名称或十六进制值设置背景颜色。
directionDeprecated-
设置选取框内的滚动方向。可能的值为
left、right、up和down。如果未指定值,则默认值为left。 heightDeprecated-
设置高度(以像素或百分比值为单位)。
hspaceDeprecated-
设置水平边距
loopDeprecated-
设置选取框滚动的次数。如果没有指定值,则默认值为-1,这意味着选取框将连续滚动。
scrollamountDeprecated-
设置每个间隔的滚动量(以像素为单位)。默认值为 6。
scrolldelayDeprecated-
设置每次滚动运动之间的间隔(以毫秒为单位)。默认值为 85。请注意,任何小于 60 的值都将被忽略,并使用值 60 代替,除非指定了
truespeed。 truespeedDeprecated-
默认情况下,低于 60 的
scrolldelay值将被忽略。如果存在truespeed,则不会忽略这些值。 vspaceDeprecated-
设置垂直边距(以像素或百分比值为单位)。
widthDeprecated-
设置宽度(以像素或百分比值为单位)。
事件处理程序
方法
示例
¥Examples
<marquee>This text will scroll from right to left</marquee>
<marquee direction="up">This text will scroll from bottom to top</marquee>
<marquee
direction="down"
width="250"
height="200"
behavior="alternate"
style="border:solid">
<marquee behavior="alternate">This text will bounce</marquee>
</marquee>
结果
技术总结
规范
| Specification |
|---|
| HTML Standard # the-marquee-element-2 |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also