📜  HTML-字幕

📅  最后修改于: 2020-12-16 05:55:48             🧑  作者: Mango


HTML字幕是滚动的一段文本,根据设置在屏幕上横向显示或垂直向下显示。这是通过使用HTML 标记创建的。

注意-HTML5中已弃用标记。不要使用此元素,而是可以使用JavaScript和CSS创建此类效果。

句法

使用HTML 标签的简单语法如下-


   One or more lines or text message or image

标记属性

以下是可以与标记一起使用的重要属性的列表。

Sr.No Attribute & Description
1

width

This specifies the width of the marquee. This can be a value like 10 or 20% etc.

2

height

This specifies the height of the marquee. This can be a value like 10 or 20% etc.

3

direction

This specifies the direction in which marquee should scroll. This can be a value like up, down, left or right.

4

behavior

This specifies the type of scrolling of the marquee. This can have a value like scroll, slide and alternate.

5

scrolldelay

This specifies how long to delay between each jump. This will have a value like 10 etc.

6

scrollamount

This specifies the speed of marquee text. This can have a value like 10 etc.

7

loop

This specifies how many times to loop. The default value is INFINITE, which means that the marquee loops endlessly.

8

bgcolor

This specifies background color in terms of color name or color hex value.

9

hspace

This specifies horizontal space around the marquee. This can be a value like 10 or 20% etc.

10

vspace

This specifies vertical space around the marquee. This can be a value like 10 or 20% etc.

以下是一些示例来说明字幕标记的用法。

范例-1

HTML marquee Tag
   
    
   
      This is basic example of marquee
   
    

这将产生以下结果-

示例-2

HTML marquee Tag
   
    
   
      This example will take only 50% width
   
    

这将产生以下结果-

示例-3

HTML marquee Tag
   

   
      This text will scroll from left to right
   
    

这将产生以下结果-

示例-4

HTML marquee Tag
   
    
   
      This text will scroll from bottom to up
   
    

这将产生以下结果-