导航:首页 > 万维百科 > 网页设计文字从下网上滚动代码

网页设计文字从下网上滚动代码

发布时间:2021-01-01 06:14:37

1、设计网页,用滚动字幕显示为:“xxxx”。 (要求文字上、下、左、右交替滚动)该怎么写代码

上下交替滚动代码:

<marquee behavior="alternate" direction="down" bgcolor="#aaaaee" align="middle" scrolldelay="120">欢迎您的光临!</marquee>


左右交版替滚动代权码:

<marquee behavior="alternate" direction="left" bgcolor="#aaaaee" align="middle" scrolldelay="120">欢迎您的光临!</marquee>

2、网页设计文字滚动(水平)代码

网页设计文字滚动(水平)代码是:

<marquee direction=up scrollamount=1 scrolldelay=100

height=60>

<!-- head_scrolltext -->

<tr>

<td>

共和国

</table> <!-- end head_scrolltext -->

</marquee>

(2)网页设计文字从下网上滚动代码扩展资料:

一、除此之外,marquee参数有以下: 

BGColor:滚动文本框的背景颜色。 

Direction:滚动方向设置,可选择Left、Right、up和down。 

scrolldelay:每轮滚动之间的延迟时间,越大越慢。 

scrollamount:一次滚动总的时间量,数字越小滚动越慢。 

Behaviour:滚动的方式设置,三种取值:Scroll(循环滚动) lide(单次滚动)、Alternate(来回滚动)。 

Align:文字的对齐方式设置。可选择Middle(居中)、Bottom(居下)还是Top(居上)。 

Width:滚动文本框的宽度,输入一个数值后从后面的单选框选择in Pixels(按像素)或是in Percent(按百分比)。 

Height:滚动文本框的高度,输入一个数值后从后面的单选框选择in Pixels(按像素)或是in Percent(按百分比)。 

loop:滚动次数。默认为infinite 

hspace、vspace:前后、上下的空行。

二、滚动字幕在FrontPage的组件里有,但是FrontPage这个软件只能支持单行文字,一出现多行文字它就无能为力了,而且它只能支持一行滚动。(如果出现只能滚动一行的情况,解决办法是把这段代码嵌入到JavaScript的document.write里面。)

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

文字滚动是由<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:顶部对齐

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

14

<marquee>

width="300px"

height="200px"

behavior="scroll"

direction="left"

scrollamount="50"

loop="10"

限制滚动文字的范围

限制滚动文字的范围

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

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

设置文字滚动的速度

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

5、关于网页制作滚动字幕的代码,请教。

如果这段代码复制到我的电脑上,保存为文件后也显示为空白的一条专!你使用图片作为背景属,我想应该是一有深色颜色的图片吧,用来反衬显示的白色文字.但由于你用的图片使用了绝对路径,在别人的电脑上怎么能保证也在相同的位置有这一图片呢?所以没有图片衬托后,白色的文字就不能显出出来了,所以只能看到白色的一条,如果你用鼠标去选择一下,应该是可以看到滚动的蓝色文字的吧.

6、html中如何制作随着屏幕滚动的文字(就是会跟着屏幕走的文字)

图片滚动代码 (从右向左滚动)

<marquee scrollamount=1 scrolldelay=3 valign=middle behavior="scroll">

<img border="0" src=" http://要滚动的图片地址1">

<img border="0" src=" http://要滚动的图片地址2">

</marquee>

图片滚动代码 (从下往上滚动)

<marquee onMouseOver="this.stop()" onMouseOut="this.start()" align=center direction=up scrollamount=1 scrolldelay=3 valign=middle behavior="scroll">

<img border="0" src=" http://要滚动的图片地址1">

<img border="0" src=" http://要滚动的图片地址2"> <marquee ONMOUSEOUT=this.scrollDelay=1 ONMOUSEOVER=this.scrollDelay=600 scrollamount=1 SCROLLDELAY=1 border=0 direction=up scrolldelay=70 width=180 height=130 align=middle>
把图片的连接地址写在这里
</marquee>
1.direction属性:决定文本的滚动方向,分为向左left和向右right,up和down默认状态向左。
<marquee direction=left>从右向左滚动</marquee>
<marquee direction=right>从左向右滚动</marquee>
2.behavior属性:指定文本的滚动方式,分为三种:
Scroll:从一端消失后,在另一端出现并继续滚动。
<marquee behavior=scroll>一圈一圈地滚动</marquee>
Slide:从一端滚动,接触到另一端后停止
<marquee behaviro=slide>只滚动一次就停止</marquee>
Alternate:从一端滚动到另一端后,反向滚动。
<marquee behavior=alternate>来回滚动</marquee>
direction=up(left、right、down) 这个属性可以更改,这样就可以实现上下左右了 但是.我建议用一种无缝的文字滚动.这样的效果会比较好看.而用marquee就没那么好了方法代码 先介绍一下它的实现思路:一个设定宽度并且隐藏超出它宽度的内容的容器demo,里面放demo1和demo2,demo1是滚动内容,demo2为demo1的直接克隆,通过不断改变demo1的scrollTop或者scrollLeft达到滚动的目的,当滚动至demo1与demo2的交界处时直接跳回初始位置,因为demo1与demo2一样,所以分不出跳动的瞬间,从而达到“无缝”滚动的目的。

先了解一下对象的几个的属性:
innerHTML:设置或获取位于对象起始和结束标签内的 HTML
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetLeft:获取对象相对于版面或由 offsetParent 属性指定的父坐标的计算左侧位置
offsetTop:获取对象相对于版面或由 offsetTop 属性指定的父坐标的计算顶端位置
offsetWidth:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的宽度

向上滚动的代码:
<div id=demo style=overflow:hidden;height:400;width:160;background:#214984;color:#ffffff><table align=top cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="pic/1.jpg" width="156" height="200" /><br><img src="pic/2.jpg" width="160" height="198" /><br><img src="pic/3.jpg" width="155" height="200" /><br><img src="pic/4.jpg" width="157" height="200" /></td></tr><tr><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML//克隆demo1为demo2
function Marquee(){
if(demo2.offsetHeight-demo.scrollTop<=0)//当滚动至demo1与demo2交界时
demo.scrollTop-=demo1.offsetHeight//demo跳到最顶端
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)//设置定时器
demo.onmouseover=function() {clearInterval(MyMar)}//鼠标移上时清除定时器达到滚动停止的目的
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//鼠标移开时重设定时器
</script>

向下滚动:
<div id=demo style=overflow:hidden;height:400;width:160;background:#214984;color:#ffffff><table align=top cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="pic/1.jpg" width="156" height="200" /><br><img src="pic/2.jpg" width="160" height="198" /><br><img src="pic/3.jpg" width="155" height="200" /><br><img src="pic/4.jpg" width="157" height="200" /></td></tr><tr><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo.scrollTop<=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop--
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

向左滚动:
<div id=demo style=overflow:hidden;height:200;width:500;background:#214984;color:#ffffff><table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="pic/1.jpg" width="156" height="200" /><img src="pic/2.jpg" width="160" height="198" /><img src="pic/3.jpg" width="155" height="200" /><img src="pic/4.jpg" width="157" height="200" /></td><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

向右滚动:
<div id=demo style=overflow:hidden;height:200;width:500;background:#214984;color:#ffffff><table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="pic/1.jpg" width="156" height="200" /><img src="pic/2.jpg" width="160" height="198" /><img src="pic/3.jpg" width="155" height="200" /><img src="pic/4.jpg" width="157" height="200" /></td><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>

7、在网站设计中:文字垂直向上滚动怎么弄,求代码、CSS,求详解???

这段代码你看下是不是你要的效果。如果不是可以继续追问
<div style="width:200px; height:300px">
<marquee direction="up" truespeed="truespeed" height="300px" behavior="scroll">
<p></p>
<p></p>
<p></p></marquee></div>

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

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>标签的动态行为学习。  

与网页设计文字从下网上滚动代码相关的知识