html文字向左移动

html-css06

html文字向左移动,第1张

文字向左移动代码:

<marquee direction=left>需要移动的文字</marquee>

marquee:

<marquee>标签,是成对出现的标签,首标签<marquee>和尾标签</marquee>之间的内容就是滚动内容。

<marquee>标签的属性主要有behavior、bgcolor、direction、width、height、hspace、vspace、loop、scrollamount、scrolldelay等,它们都是可选的。

扩展资料:

1、behavior属性:

behavior属性的参数值为alternate、scroll、slide中的一个,分别表示文字来回滚动、单方向循环滚动、只滚动一次。

如果在<marquee>标签中同时出现了direction和behavior属性,那么scroll和slide的滚动方向将依照direction属性中参数的设置。

示例:

<marquee behavior="alternate">我来回滚动</marquee>

<marquee behavior="scroll">我单方向循环滚动</marquee>

<marquee behavior="scroll" direction="up" height="30">我改单方向向上循环滚动</marquee>

<marquee behavior="slide">我只滚动一次</marquee>

<marquee behavior="slide" direction="up">我改向上只滚动一次了</marquee>

2、bgcolor属性:

文字滚动范围的背景颜色,参数值是16进制(形式:#AABBCC或#AA5566等)或预定义的颜色名字(如red、yellow、blue等)。

示例:

<marquee behavior=="slide" direction="left" bgcolor="red">我的背景色是红色的</marquee> 

3、direction属性:

文字滚动的方向,属性的参数值有down、left、right、up共四个单一可选值,分别代表滚动方向向下、向左、向右、向上。

示例:

<marquee direction="right">我向右滚动</marquee>

<marquee direction="right">我向下滚动</marquee>

文字部分 \x0d\x0ascrollAmount。它表示速度,值越大速度越快。如果没有它,默认为6,建议设为1~3比较好。\x0d\x0adirection表示滚动的方向,默认为从右向左:←←←。可选的值有right、down、up。滚动方向分别为:right表示→→→,up 表示↑,down表示↓。\x0d\x0ascrollDelay,这也是用来控制速度的,默认为90,值越大,速度越慢。通常scrollDelay是不需要设置的。