search
HomeWeb Front-endHTML TutorialDetailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose

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 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')< /script></script>

e) Change the color of the scrolling subtitles? Can be controlled using style sheets. The following effect, the code is Are you okay.
Are you okay?

Picture scrolling
Use the statement Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose. And be careful not to use Chinese in the picture name, and pay attention to English case distinction.

Make a hyperlink to a picture
Use and to surround Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose, 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>Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose a>
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.

Arrange and scroll multiple pictures
Usually use
(line return) or

(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.

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 alt="Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose" >') </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 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')< /script></script>

e) Change the color of the scrolling subtitles? Can be controlled using style sheets. The following effect, the code is Are you okay.
Are you okay?

Picture scrolling
Use the statement Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose. And be careful not to use Chinese in the picture name, and pay attention to English case distinction.

Make a hyperlink to a picture
Use and to surround Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose, 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>Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose a>
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.

Arrange and scroll multiple pictures
Usually use
(line return) or

(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.

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 alt="Detailed explanation of HTML rolling subtitle code and parameters_html/css_WEB-ITnose" >') </script>

Statement
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
What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

How do you create a list in HTML?How do you create a list in HTML?May 06, 2025 am 12:01 AM

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML in Action: Examples of Website StructureHTML in Action: Examples of Website StructureMay 05, 2025 am 12:03 AM

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

HTML's Purpose: Enabling Web Browsers to Display ContentHTML's Purpose: Enabling Web Browsers to Display ContentMay 03, 2025 am 12:03 AM

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

Explain the importance of using consistent coding style for HTML tags and attributes.Explain the importance of using consistent coding style for HTML tags and attributes.May 01, 2025 am 12:01 AM

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

How to implement multi-project carousel in Bootstrap 4?How to implement multi-project carousel in Bootstrap 4?Apr 30, 2025 pm 03:24 PM

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment