導航:首頁 > 萬維百科 > 網頁設計中怎麼設置滾動文字

網頁設計中怎麼設置滾動文字

發布時間:2020-08-29 17:23:05

1、怎樣在網頁設計中把所需的文字從左到右滾動

14

<marquee>

width="300px"

height="200px"

behavior="scroll"

direction="left"

scrollamount="50"

loop="10"

限制滾動文字的范圍

限制滾動文字的范圍

限制滾動文字的行為(alternate:來回、scroll:循環滾動、slide:只滾動一次)

滾動的方向(left、right、down、up)

設置文字滾動的速度

設置滾動的次數
看看 有用嗎?

2、網頁製作中滾動字幕怎麼整?

可以用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 網上有很多代碼 你可以自己去找

3、網頁設計中 怎樣讓滾動的文字在滑鼠移到它時停下

<SCRIPT language=JavaScript>

var marqueewidth=160

var marqueeheight=120

var speed=1

var marqueecontents=

ef="<div class=bbb ><center>公 告</center> 公司網站正在更新之中,如果瀏覽出現問題,請與管理員聯系。謝謝!!"

if(document.all)

document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+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(marqueecontents)

document.cmarquee01.document.cmarquee02.document.close()

thelength=document.cmarquee01.document.cmarquee02.document.height

scrollit()

}function scrollit(){if(document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){document.cmarquee01.document.cmarquee02.top-=speed

setTimeout("scrollit()",100)

}else{document.cmarquee01.document.cmarquee02.top=marqueeheight

scrollit()

}}window.onload=regenerate2

</SCRIPT>

4、網頁設計中怎麼在頁面中設置一個滾動條

css屬性 overflow-y:auto; DIV裡面的內容超過DIV的高度,右邊就會自動出現滾動條

1、用一個div,定製成圖中的寬度和高度
2、然後再把div的樣式設成overflow-y:scroll,當div里的文字超出那個高度的時候,滾動條就出來了。
例如:<div style="width:100px; height:100px; overflow:auto; border:1px solid #000000;"><img src="" style="width:300px; height:300px;"></div>

5、製作網頁如何使字體滾動

http://www.gzsums.e.cn/webclass/html/marquee.html

以上是會動的文字網站。裡面有代碼。

基本語法

<marquee> ... </marquee>
<marquee>啦啦啦,我會移動耶!</marquee>
啦啦啦,我會移動耶!

文字移動屬性的設置

方向 <direction=#> #=left, right
<marquee direction=left>啦啦啦,我從右向左移!</marquee> <P>
<marquee direction=right>啦啦啦,我從左向右移!</marquee>
啦啦啦,我從右向左移!

啦啦啦,我從左向右移!

方式 <bihavior=#> #=scroll, slide, alternate
<marquee behavior=scroll>啦啦啦,我一圈一圈繞著走!</marquee> <P>
<marquee behavior=slide>啦啦啦,我只走一次就歇了!</marquee> <P>
<marquee behavior=alternate>啦啦啦,我來回走耶!</marquee>
啦啦啦,我一圈一圈繞著走!

啦啦啦,我只走一次就歇了!

啦啦啦,我來回走耶!

循環 <loop=#> #=次數;若未指定則循環不止(infinite)
<marquee loop=3 width=50% behavior=scroll>啦啦啦,我只走 3 趟喲!</marquee> <P>
<marquee loop=3 width=50% behavior=slide>啦啦啦,我只走 3 趟喲!</marquee> <P>
<marquee loop=3 width=50% behavior=alternate>啦啦啦,我只走 3 趟喲!</marquee>
啦啦啦,我只走 3 趟喲!

啦啦啦,我只走 3 趟喲!

啦啦啦,我只走 3 趟喲!

速度 <scrollamount=#>
<marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>
啦啦啦,我走得好快喲!

延時 <scrolldelay=#>
<marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
啦啦啦,我走一步,停一停!

外觀(Layout)設置

對齊方式(Align) <align=#> #=top, middle, bottom
<font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>
對齊上沿、中間、下沿。
啦啦啦,我會移動耶!對齊上沿。

啦啦啦,我會移動耶!對齊中間。

啦啦啦,我會移動耶!對齊下沿。

底色 <bgcolor=#>
#=rrggbb 16 進制數碼,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
<marquee bgcolor=aaaaee>啦啦啦,我會移動耶!</marquee>
啦啦啦,我會移動耶!

面積 <height=# width=#>
<marquee height=40 width=50% bgcolor=aaeeaa>
啦啦啦,我會移動耶!
</marquee>
啦啦啦,我會移動耶!

空白(Margins)<hspace=# vspace=#>
********************************************<br>
嗨,
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>啦啦啦,我會移動耶!</marquee>
大家好!<br>
********************************************
********************************************
嗨, 啦啦啦,我會移動耶!大家好!
********************************************

6、怎麼製作網頁動態滾動文字...

用marquee即可
比如:
<marquee direction="right" behavior="scroll" scrollamount="10" scrolldelay="200">這是一個滾動字幕</marquee>
在裡面加入marquee裡面加入herf標簽,應該就能實現滾動鏈接裡面添加愛鏈接,marqueen之間也可以和資料庫連接

7、如何製作網頁滾動文字

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>標簽的動態行為學習。  

與網頁設計中怎麼設置滾動文字相關的知識