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></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:頂部對齊
3、在網頁中如何設置滾動字幕
工具/原料
Dreamweaver
屬性釋義
滾動文字在HTML里的標簽為marquee--無間斷滾動,使用代碼為<marquee>滾動文字<marquee/>。
END
屬性值
direction:指文字滾動的方向,值為left--從左到右、right--從右到左、up--從上到下、down--從下到上。系統默認為right。
behavior :指文字滾動的方式,值為scroll--連續滾動、slide--滾動一次、alternate--來回滾動。系統默認為scroll。
scrollAmount:指文字滾動的速度,值為正整數,數值越大則滾動越快。系統默認為6,一般設置為1-3。
END
實操
打開HTM文件,輸入代碼<marquee>這里是滾動文字!<marquee/>。
設置它又到左、來回滾動、速度為3、背景色為粉色。
3
預覽效果如下,速度為3稍微有點快,還是2比較合適。
4、HTML5怎麼設置滾動字幕?
<marquee direction=up behavior=scroll loop=3 scrollamount=1 scrolldelay=10 align=top bgcolor=#ffffff height=300 width=30% hspace=20 vspace=10 onmouseover=this.stop() onmouseout=this.start()> 此處輸入滾動內容 </marquee>
◎ direction表示滾動的方向,值可以是,right,up,down,默認為left
◎ behavior表示滾動的方式,值可以是scroll(連續滾動)slide(滑動一次)alternate(往返滾動)
◎ loop表示循環的次數,值是正整數,默認為無限循環
◎ scrollamount表示運動速度,值是正整數,默認為6
◎ scrolldelay表示停頓時間,值是正整數,默認為0,單位似乎是毫秒
◎ align表示元素的垂直對齊方式,值可以是top,middle,bottom,默認為middle
◎ bgcolor表示運動區域的背景色,值是16進制的RGB顏色,默認為白色
◎ height、width表示運動區域的高度和寬度,值是正整數(單位是像素)或百分數,默認width=100% height為標簽內元素的高度
◎ hspace、vspace表示元素到區域邊界的水平距離和垂直距離,值是正整數,單位是像素。
◎ onmouseover=this.stop() onmouseout=this.start()表示當滑鼠以上區域的時候滾動停止,當滑鼠移開的時候又繼續滾動。
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、如何設置網頁滾動字幕
在FRONTPAGE中,選擇『插入』-『WEB組件』然後你就會看到有『字幕』這個選項....
以下操作你應該知道了
7、怎麼製作網頁滾動字幕
<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>
8、網頁中的滾動字幕怎麼做?
<blockquote><marquee
direction="up"
scrollamount="1"
height="260"
onmouseover='this.stop()'
onmouseout='this.start()'
width="447">
<p
class="STYLE8">後面加文字內容
這是我做網頁中的一段代碼,給你借鑒一下專,其中的height="260"是我的文字的幅高屬width="447"是文字幅寬,這個你不用一樣,<p
class="STYLE8">這是我做的一個文字的CSS樣式,你也不用一樣,其中的onmouse這是指滑鼠在文字上面字幕停止,滑鼠離開後,字幕繼續滾動的代碼,主要對滑鼠的
你試下
9、設計網頁,用滾動字幕顯示為:「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>