Home Web Front-end HTML Tutorial Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose

Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose

Jun 24, 2016 am 11:41 AM

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 >
Copy after login
Copy after login


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>
Copy after login
Copy after login


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 CCTV, click CCTV to enter :
CCTV

b) How to make the text stop scrolling when the mouse stays on it?
The code is like:
Text content
The effect is like:
Text content

c) Alternating effect. The code is like:
Text content
The effect is like:
Text content

d ) multi-line text scrolls up. Code such as:
·Good morning!
·The air is so fresh
·Are you okay

·Beautiful scenery


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()>&lt ;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 >
Copy after login
Copy after login


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>
Copy after login
Copy after login


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 CCTV, click CCTV to enter :
CCTV

b) How to make the text stop scrolling when the mouse stays on it?
The code is like:
Text content
The effect is like:
Text content

c) Alternating effect. The code is like:
Text content
The effect is like:
Text content

d ) multi-line text scrolls up. Code such as:
·Good morning!
·The air is so fresh
·Are you okay

·Beautiful scenery


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()>&lt ;a href=http://www.webshu.com><img src=http://www.cnblogs.com/j/01.jpg border=0></a></marquee>') </script>

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 &lt;time&gt; element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

See all articles