html text scrolling code
<marquee style="WIDTH: 388px; HEIGHT: 200px" scrollamount="2" direction="up" ><div align="left" ><br /></div ><center ><font face="黑体" color="#008000" size="4" ></font ></center ><div align="left" ><br /></div ><center ><p ><font color="#ff6600" size="4" >滚动文字</font ></p ><p ><font color="#ff4500" size="4" >滚动文字</font ></p ><p ><font color="#ff3300" size="4" >滚动文字</font ><br /><br /></p ></marquee >
marquee parameter:
BGColor : The background color of the scrolling text box.
Direction: Scroll direction setting, you can choose Left, Right, up and down.
scrolldelay: The delay time between each round of scrolling, the larger the time, the slower it will be.
scrollamount: The total amount of time for a scroll. The smaller the number, the slower the scrolling.
Behaviour: Setting the scrolling method, three values: Scroll (cyclic scrolling), slide (single scrolling), Alternate (scrolling back and forth).
Align: text alignment setting. You can choose Middle, Bottom or Top.
Width: The width of the scrolling text box. Enter a value and select in Pixels (by pixels) or in Percent (by percentage) from the radio button at the back.
Height: The height of the scrolling text box. Enter a value and select in Pixels (by pixels) or in Percent (by percentage) from the radio button at the back.
loop: number of scrolls. The default is infinite
hspace, vspace: blank lines before and after, top and bottom.
Rolling subtitles will make many people excited, especially when they use rolling subtitles for the first time, they will not be able to put it down. I’ve done a lot of scrolling subtitles, and I’m no longer excited about it, so I don’t use it much now. Many friends often ask how this is done. Now I will make a detailed topic to give you a more comprehensive understanding.
Scrolling subtitles are available in FrontPage components, but FrontPage is a software that can only support single lines of text. It cannot do anything when multiple lines of text appear, and it can only support one line of scrolling! (If you can only scroll one line, the solution is to embed this code into document.write in JavaScript. Please see the detailed instructions in Example d below) Dreamweaver can only use the method of writing HTML code. Therefore, it is strongly recommended to use Notepad to open the source code of the web page for editing.
1. Create the first rolling subtitle. Code:
<marquee scrollAmount=2 width=300>靓丽风景线</marquee>
The effect is as follows: Beautiful scenery
2. Detailed explanation of each parameter:
a)scrollAmount. It represents speed, the larger the value, the faster the speed. If it is not available, the default is 6. It is recommended to set it to 1 to 3.
b) width and height, represent the size of the scrolling area, width is the width, and height is the height. Especially when doing vertical scrolling, the height value must be set.
c)direction. Indicates the direction of scrolling, the default is from right to left: ←←←. Optional values are right, down, and up. The scrolling directions are: right means →→→, up means ↑, and down means ↓.
d) scrollDelay, which is also used to control the speed. The default is 90. The larger the value, the slower the speed. Usually scrollDelay does not need to be set.
e)behavior. Use it to control attributes. The default is circular scrolling. Optional values include alternate (alternating scrolling) and slide (slide effect, which refers to scrolling once and then stopping scrolling)
3. Example:
a) How to add a hyperlink to rolling subtitles? This is exactly the same as a normal hyperlink. Just add and outside the text. The following effect, the code is , click CCTV to enter :
CCTV
b) How to make the text stop scrolling when the mouse stays on it?
The code is like:
The effect is like:
Text content
c) Alternating effect. The code is like:
The effect is like:
Text content
d ) multi-line text scrolls up. Code such as:
The effect is as follows:
·Good morning!
·The air is so fresh
·Are you okay
·Beautiful scenery
·Note: If your webpage has been edited by FrontPage, after saving, you can only scroll one line. At this time, you find that the order of your original code has changed, My god! The solution is to find the original code and embed it into JavaScript document.write. The above code is written as:
<script>document.write('<marquee scrollAmount=2 width=300 height=160 direction=up>·Good morning! <br>·The air is so fresh<br>·Are you okay<p>·<a href=http://www.cctv.com> Beautiful scenery</a></marquee>')< /script></p> <p> </p> <p>e) Change the color of the scrolling subtitles? Can be controlled using style sheets. The following effect, the code is <marquee scrollAmount=2 width=300><a style=color:CC6600>Are you okay</a></marquee>. <br />Are you okay?</p> <p> </p> <p>Picture scrolling<br />Use the statement <img src=relative path/file name>. And be careful not to use Chinese in the picture name, and pay attention to English case distinction. </p> <p> </p> <p>Make a hyperlink to a picture<br />Use <a href=> and </a> to surround <img>, and img must set border=0, otherwise the picture A blue box will appear. Correct examples are: & amp; lt;a href=http://www.webshu.com><img src=http://www.cnblogs.com/j/01.jpg border=0></ a><br />where a href= represents a hyperlink, which is the most commonly used. The practice method is also very simple, that is, when you usually use FP or DW to make web pages, you should check the source code more. </p> <p> </p> <p>Arrange and scroll multiple pictures<br />Usually use <br> (line return) or <p style=margin-top:9> (accurate adjustment) between pictures distance between images) to link. You can also format your pictures in a table first, and then add all the statements of the table to the marquee to let the table scroll. </p> <p> </p> <p>Code<script>document.write('<marquee scrollAmount=2 width=340 height=160 direction=up onmouseover=stop() onmouseout=start()>< ;a href=http://www.webshu.com><img src=http://www.cnblogs.com/j/01.jpg border=0></a></marquee>') </script>
<marquee style="WIDTH: 388px; HEIGHT: 200px" scrollamount="2" direction="up" ><div align="left" ><br /></div ><center ><font face="黑体" color="#008000" size="4" ></font ></center ><div align="left" ><br /></div ><center ><p ><font color="#ff6600" size="4" >滚动文字</font ></p ><p ><font color="#ff4500" size="4" >滚动文字</font ></p ><p ><font color="#ff3300" size="4" >滚动文字</font ><br /><br /></p ></marquee >
marquee Parameters:
BGColor: The background color of the scrolling text box.
Direction: Scroll direction setting, you can choose Left, Right, up and down.
scrolldelay: The delay time between each round of scrolling, the larger the time, the slower it will be.
scrollamount: The total amount of time for a scroll. The smaller the number, the slower the scrolling.
Behaviour: Setting the scrolling method, three values: Scroll (cyclic scrolling), slide (single scrolling), Alternate (scrolling back and forth).
Align: text alignment setting. You can choose Middle, Bottom or Top.
Width: The width of the scrolling text box. Enter a value and select in Pixels (by pixels) or in Percent (by percentage) from the radio button at the back.
Height: The height of the scrolling text box. Enter a value and select in Pixels (by pixels) or in Percent (by percentage) from the radio button at the back.
loop: number of scrolls. The default is infinite
hspace, vspace: blank lines before and after, top and bottom.
Rolling subtitles will make many people excited, especially when they use rolling subtitles for the first time, they will not be able to put it down. I’ve done a lot of scrolling subtitles, and I’m no longer excited about it, so I don’t use it much now. Many friends often ask how this is done. Now I will make a detailed topic to give you a more comprehensive understanding.
Scrolling subtitles are available in FrontPage components, but FrontPage is a software that can only support single lines of text. It cannot do anything when multiple lines of text appear, and it can only support one line of scrolling! (If you can only scroll one line, the solution is to embed this code into document.write in JavaScript. Please see the detailed instructions in Example d below) Dreamweaver can only use the method of writing HTML code. Therefore, it is strongly recommended to use Notepad to open the source code of the web page for editing.
1. Create the first rolling subtitle. Code:
<marquee scrollAmount=2 width=300>靓丽风景线</marquee>
The effect is as follows: Beautiful scenery
2. Detailed explanation of each parameter:
a) scrollAmount. It represents speed, the larger the value, the faster the speed. If it is not available, the default is 6. It is recommended to set it to 1 to 3.
b) width and height, represent the size of the scrolling area, width is the width, and height is the height. Especially when doing vertical scrolling, the height value must be set.
c)direction. Indicates the direction of scrolling, the default is from right to left: ←←←. Optional values are right, down, and up. The scrolling directions are: right means →→→, up means ↑, and down means ↓.
d) scrollDelay, which is also used to control the speed. The default is 90. The larger the value, the slower the speed. Usually scrollDelay does not need to be set.
e)behavior. Use it to control attributes. The default is circular scrolling. Optional values are alternate (alternating scrolling) and slide (slide effect, which refers to scrolling once and then stopping scrolling)
3. Example:
a) How to add a hyperlink to rolling subtitles? This is exactly the same as a normal hyperlink. Just add and outside the text. The following effect, the code is , click CCTV to enter :
CCTV
b) How to make the text stop scrolling when the mouse stays on it?
The code is like:
The effect is like:
Text content
c) Alternating effect. The code is like:
The effect is like:
Text content
d ) multi-line text scrolls up. Code such as:
The effect is as follows:
·Good morning!
·The air is so fresh
·Are you okay?
·Beautiful scenery
·Note: If your webpage has been edited by FrontPage, after saving, only You can scroll one line. At this time, you find that the order of your original code has changed. My god! The solution is to find the original code and embed it into JavaScript document.write. The above code is written as:
<script>document.write('<marquee scrollAmount=2 width=300 height=160 direction=up>·Good morning! <br>·The air is so fresh<br>·Are you okay<p>·<a href=http://www.cctv.com> Beautiful scenery</a></marquee>')< /script></p> <p> </p> <p>e) Change the color of the scrolling subtitles? Can be controlled using style sheets. The following effect, the code is <marquee scrollAmount=2 width=300><a style=color:CC6600>Are you okay</a></marquee>. <br>Are you okay?</p> <p> </p> <p>Picture scrolling<br>Use the statement <img src=relative path/file name>. And be careful not to use Chinese in the picture name, and pay attention to English case distinction. </p> <p> </p> <p>Make a hyperlink to a picture<br>Use <a href=> and </a> to surround <img>, and img must set border=0, otherwise the picture A blue box will appear. Correct examples are: & amp; lt;a href=http://www.webshu.com><img src=http://www.cnblogs.com/j/01.jpg border=0></ a><br>where a href= represents a hyperlink, which is the most commonly used. The practice method is also very simple, that is, when you usually use FP or DW to make web pages, you should check the source code more. </p> <p> </p> <p>Arrange and scroll multiple pictures<br>Usually use <br> (line return) or <p style=margin-top:9> (accurate adjustment) between pictures distance between images) to link. You can also format your pictures in a table first, and then add all the statements of the table to the marquee to let the table scroll. </p> <p> </p> <p>Code<script>document.write('<marquee scrollAmount=2 width=340 height=160 direction=up onmouseover=stop() onmouseout=start()>< ;a href=http://www.webshu.com><img src=http://www.cnblogs.com/j/01.jpg border=0></a></marquee>') </script>