导航:首页 > 万维百科 > 网页设计加滚动字幕

网页设计加滚动字幕

发布时间:2020-10-01 14:11:56

1、网页制作中滚动字幕怎么整?

可以用javascript实现 也可以用<marquee>滚动字幕内容</marquee> <marquee>标签还有很多属性 <marquee direction="up" id="mar" width="100%" height="220" onMouseOut="mar.start()" onMouseOver="mar.stop()" scrollAmount="1" scrollDelay="50" border="0" class="text"> <marquee> 比如这段代码 就是个上下滚动的字母 而且有鼠标悬停效果 javascript 网上有很多代码 你可以自己去找

2、如何制作网页上的滚动字幕? 快!!!

<MARQUEE onmouseover=this.stop() onmouseout=this.start() scrollAmount=4 behavior=alternate width="100%" height=220>

来回滚动

3、在制作网页时做滚动字幕的代码是什么?急用

脚本说明:
把如下代码加入<body>区域中:
<script language="JavaScript1.2">
//设置marquee的宽度 (in pixels)
var marqueewidth=400
//设置marquee的高度 (in pixels, 该参数只适用于NS)
var marqueeheight=20
//设置marquee滚动的速度(数值大速度快)
var speed=4
//设置marquee显示内容,使用标准的HTML语法。
var marqueecontents='<strong><big>滚动字幕</big></strong></font>'
if (document.all)
document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}
window.onload=regenerate2
</script>
<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer>
</ilayer>

4、怎么制作网页滚动字幕

<style>
marquee{
width:500px;
height:100px;
background:gray;
color:red;
}
</style>
<marquee direction="up" scrollamount="1">
滚动文字direction="up"向上滚,down向下滚,left向左,right向右;scrollamount="1"滚动速度。
width设置宽,height高,background背景颜色,color文字颜色
</marquee>

5、如何制作网页滚动文字

4.3.1 设置文字滚动

HTML技术中使文字滚动的方法是使用双标签<marquee></marquee>。在HTML代码中可使其作用区文字滚动,默认为从右到左,循环滚动。在D:web目录下创建网页文件,命名为mar.htm,编写代码如代码4.15所示。 

代码4.15 文字滚动的设置:mar.htm

<html>
<head>

<title>文字滚动的设置</title>
</head>
<body>

<font size="5" color="#cc0000">

文字滚动示例(默认):<marquee>做人要厚道</marquee>
</font>

</body>
</html> 

图4.15 设置文字滚动默认形式
从图4.15可得,在未设置宽度时,<marquee></marquee>标签是独占一行的。

4.3.2 设置文字滚动的方向

<marquee></marquee>标签的direction属性用于设置内容滚动方向,属性值有left、right、up、down,分别代表向左、向右、向上、向下,例如以下代码:

<marquee direction="left">做人要厚道</marquee>
<marquee
direction="right">做人要厚道</marquee>
<marquee
direction="up">做人要厚道</marquee>
<marquee
direction="down">做人要厚道</marquee>
4.3.3
设置文字滚动的速度和形式
设置文字滚动使用<marquee></marquee>标签,其属性说明如下。

— <marquee></marquee>标签的scrollamount属性用于设置内容滚动速度。

<marquee></marquee>标签的behavior
属性用于设置内容滚动方式,默认为scroll,即循环滚动,当其值为alternate时,内容将来回循环滚动。当其值为slide时,内容滚动一次即停止,不会循环。还有一个loop属性可设置其滚动循环次数,默认为没有限制。

— <marquee></marquee>标签的scrolldelay属性用于设置内容滚动的时间间隔。

<marquee></marquee>标签的bgcolor属性用于设置内容滚动背景色(类似于body的背景色设置)。

<marquee></marquee>标签的width 属性用于设置内容滚动背景宽度。

<marquee></marquee>标签的height属性用于设置内容滚动背景高度。

修改mar.htm网页文件,编写代码如代码4.16所示。

代码4.16 文字滚动的设置:mar.htm


<html>
<head>
<title>文字滚动的设置</title>

</head>
<body>
<font size="3" color="#cc0000">

文字滚动示例(默认):<marquee>做人要厚道</marquee>
文字滚动示例(向右):<marquee
direction="right" scrolldelay="500">做人要厚道</marquee>

文字滚动示例(向下,滚动方式为slide,速度为10):<marquee scrollamount="10"
behavior="slide">做人要厚道</marquee>

文字滚动示例(默认方向,滚动方式为alternate,循环3次,速度为2):<marquee scrollamount="2"
behavior="alternate" loop="3">做人要厚道</marquee>

文字滚动示例(向上,背景色为#CCFF66,设置了背景宽度和高度):<marquee direction="up"
bgcolor="#CCFF66" width="250" height="55">做人要厚道</marquee>

</font>
</body>
</html>

在浏览器地址栏输入http://localhost/mar.htm,浏览效果如图4.16所示。 

图4.16 文字滚动的不同形式

<marquee></marquee>的众多属性能非常方便地制作滚动文字,在后面的JavaScript学习中,读者将继续深化<marquee></marquee>标签的动态行为学习。  

6、怎样在网页设计中把所需的文字从左到右滚动

14

<marquee>

width="300px"

height="200px"

behavior="scroll"

direction="left"

scrollamount="50"

loop="10"

限制滚动文字的范围

限制滚动文字的范围

限制滚动文字的行为(alternate:来回、scroll:循环滚动、slide:只滚动一次)

滚动的方向(left、right、down、up)

设置文字滚动的速度

设置滚动的次数
看看 有用吗?

7、网页设计中,如何插入垂直滚动字幕,请给出html代码

<marquee direction="up" scrolldelay="100" scrollamount="1" onMouseOver="this.stop()" onMouseOut="this.start()" height="159 width=302">滚动的内容</marquee>

8、网页设计字体滚动代码?

文字滚动是由<marquee></marquee>控制的。marquee的参数如下:

1、方向 <direction=#> #=left, right
如:<marquee direction=left>啦啦啦,我从右向左移!</marquee>
<marquee direction=right>啦啦啦,我从左向右移!</marquee>

2、方式 <bihavior=#> #=scroll, slide, alternate
如:<marquee behavior=scroll>啦啦啦,我一圈一圈绕着走!</marquee>
<marquee behavior=slide>啦啦啦,我只走一次就歇了!</marquee>
<marquee behavior=alternate>啦啦啦,我来回走耶!</marquee>

3、循环 <loop=#> #=次数;若未指定则循环不止(infinite)
如:<marquee loop=3 width=50% behavior=scroll>啦啦啦,我只走 3 趟哟!</marquee>
<marquee loop=3 width=50% behavior=slide>啦啦啦,我只走 3 趟哟!</marquee>
<marquee loop=3 width=50% behavior=alternate>啦啦啦,我只走 3 趟哟!</marquee>

4、速度 <scrollamount=#>
如:<marquee scrollamount=20>啦啦啦,我走得好快哟!</marquee>

5、延时 <scrolldelay=#>
如: <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>

6、对齐方式(Align) <align=#> #=top, middle, bottom
如:<font size=6>
<marquee align=# width=400>啦啦啦,我会移动耶!</marquee>
</font>
7、底色 <bgcolor=#>
#=rrggbb 16 进制数码,或者是下列预定义色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua

如:<marquee bgcolor=aaaaee>啦啦啦,我会移动耶!</marquee>

8、面积 <height=# width=#>
如:<marquee height=40 width=50% bgcolor=aaeeaa> 啦啦啦,我会移动耶!</marquee>

9、空白(Margins)<hspace=# vspace=#>

<marquee id="scrollarea" direction="up" scrolldelay="10" scrollamount="1" width="150" height="80" onmouseover="this.stop();" onmouseout="this.start();">
------------------------------------------------------------------------------------------------------------------------------

<marquee></marquee>

以下是一个最简单的例子:

代码如下:

<marquee><font size=+3 color=red>Hello, World</font></marquee>

下面这两个事件经常用到:

onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动

onMouseOver="this.stop()":用来设置鼠标移入该区域时停止滚动

代码如下:

<marquee >onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动 :用来设置鼠标移入该区域时停止滚动</marquee>

这是一个完整的例子:

代码如下:

<marquee align="left" behavior="scroll" bgcolor="#FF0000" direction="up" height="300" width="200" hspace="50" vspace="20" loop="-1" scrollamount="10" scrolldelay="100" >

这是一个完整的例子

</marquee>

该标签支持的属性多达11个:

align

设定<marquee>标签内容的对齐方式

absbottom:绝对底部对齐(与g、p等字母的最下端对齐)

absmiddle:绝对中央对齐

baseline:底线对齐

bottom:底部对齐(默认)

left:左对齐

middle:中间对齐

right:右对齐

texttop:顶线对齐

top:顶部对齐

与网页设计加滚动字幕相关的知识