网站建设丨金手指谷哥14,做知识问答的网站,界面设计图片 作品,wordpress判断ios或安卓marquee(文字滚动)标签 marquee简介 marquee标签,是成对出现的标签,首标签marquee和尾标签/marquee之间的内容就是滚动内容。 marquee标签的属性主要有behavior、bgcolor、direction、width、height、hspace、vspace、loop、scrollamount、scr…marquee(文字滚动)标签 marquee简介 marquee标签,是成对出现的标签,首标签marquee和尾标签/marquee之间的内容就是滚动内容。 marquee标签的属性主要有behavior、bgcolor、direction、width、height、hspace、vspace、loop、scrollamount、scrolldelay等它们都是可选的。 marquee属性 behavior属性 behavior属性的参数值为alternate、scroll、slide中的一个分别表示文字来回滚动、单方向循环滚动、只滚动一次.注意 如果在marquee标签中同时出现了direction和behavior属性那么scroll和slide的滚动方向将依照direction属性中参数的设置。 bgcolor属性 文字滚动范围的背景颜色参数值是16进制(形式:#AABBCC或#AA5566等)或预定义的颜色名字(如red、yellow、blue等)。 direction属性 文字滚动的方向属性的参数值有down、left、right、up共四个单一可选值分别代表滚动方向向下、向左、向右、向上。 width和height属性 width和height属性的作用决定滚动文字在页面中的矩形范围大小。 width属性用以规定矩形的宽度height属性规定矩形的高度。 这两个属性的参数值可以是数字或者百分数数字表示矩形所占的(宽或高)像素点数百分数表示矩形所占浏览器窗口的(宽或高)百分比。 hspace和vspace属性 这两个属性决定滚动矩形区域距周围的空白区域. loop属性 loop属性决定滚动文字的滚动次数缺省是无限循环。参数值可以是任意的正整数如果设置参数值为-1或infinite时将无限循环。 scrollamount和scrolldelay属性 这两个属性决定文字滚动的速度(scrollamount)和延时(scrolldelay)参数值都是正整数。 align属性 这个属性决定滚动文字位于距形内边框的上下左右位置。注意 您也可以将marquee和/marquee之间的内容替换为图像或其它对象等功能。
各个属性参数 direction 表示滚动的方向值可以是leftrightupdown默认为left behavior 表示滚动的方式值可以是scroll(连续滚动)slide(滑动一次)alternate(来回滚动) loop 表示循环的次数值是正整数默认为无限循环 scrollamount 表示运动速度值是正整数默认为6 scrolldelay 表示停顿时间值是正整数默认为0单位是毫秒 align 表示元素的垂直对齐方式值可以是topmiddlebottom默认为middle bgcolor 表示运动区域的背景色值是16进制的RGB颜色默认为白色 height、width 表示运动区域的高度和宽度值是正整数(单位是像素)或百分数默认width100% height为标签内元素的高度。 hspace、vspace 表示元素到区域边界的水平距离和垂直距离值是正整数单位是像素。 οnmοuseοverthis.stop() οnmοuseοutthis.start() 表示当鼠标以上区域的时候滚动停止当鼠标移开的时候又继续滚动。 综合实例
!DOCTYPE html
html langenheadmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0titlemarquee/title
/headbodymarquee directionup我向上滚动/marqueehrmarquee directiondown我向下滚动/marqueehrmarquee directionleft我向左滚动/marqueehrmarquee directionright我向右滚动/marqueehrmarquee scrollamount10我速度很慢/marqueehrmarquee scrollamount100我速度很快/marqueehrmarquee scrolldelay30我小步前进。/marqueehrmarquee scrolldelay1000 scrollamount100我大步前进。/marqueehrmarquee loop1我滚动一次/marqueehrmarquee loop2我滚动两次/marqueehrmarquee loopinfinite我无限循环滚动/marqueehrmarquee behavioralternate我来回滚动/marqueehrmarquee behaviorscroll我单方向循环滚动/marqueehrmarquee behaviorscroll directionup height30我单方向向上循环滚动/marqueehrmarquee behaviorslide我只滚动一次/marqueehrmarquee behaviorslide directionup我向上只滚动一次/marqueehrmarquee behaviorslide directionleft bgcolorred我的背景色是红色的/marqueehrmarquee width600 height50 bgcolorred我宽300像素高30像素。/marqueehrmarquee width300 height30 vspace10 hspace10 bgcolorred我矩形边缘水平和垂直距周围各10像素。/marqueehrmarquee width300 height30 vspace50 hspace50 bgcolorred我矩形边缘水平和垂直距周围各50像素。/marqueehrmarquee alignabsbottom绝对底部对齐/marqueehrmarquee alignabsmiddle绝对中央对齐/marqueehrmarquee alignbaseline底线对齐/marqueehrmarquee alignbottom底部对齐默认/marqueehrmarquee alignleft左对齐/marqueehrmarquee alignmiddle 中间对齐/marqueehrmarquee alignright右对齐/marqueehrmarquee aligntexttop顶线对齐/marqueehrmarquee aligntop顶部对齐/marquee
/body/html