Home > Web Front-end > HTML Tutorial > Web page HTML code: production of scrolling text_HTML/Xhtml_web page production

Web page HTML code: production of scrolling text_HTML/Xhtml_web page production

WBOY
Release: 2016-05-16 16:43:22
Original
2284 people have browsed it

In this section, the author describes the special tags in HTML code, which can scroll the text in the web page and control its scrolling properties.
Create scrolling text
Through the previous studies in this chapter, readers have been able to well control the display method of various paragraph text, but no matter how they are set, the text is static. In this section, the author describes the special tags in HTML code, which can scroll the text in the web page and control its scrolling properties.
4.3.1 Set text scrolling
The way to scroll text in HTML technology is to use double tags . In the HTML code, the text in the scope can be scrolled. The default is from right to left and circular scrolling. Create a web page file in the D:web directory, name it mar.htm, and write the code as shown in Code 4.15.

Code 4.15 Text scrolling settings: mar.htm



Text scrolling settings



Text scrolling example (default): Be kind



Enter http://localhost/mar.htm in the browser address bar, and the browsing effect is as shown in Figure 4.15.

Figure 4.15 Set the default form of text scrolling
From Figure 4.15, when the width is not set, the tag occupies an exclusive line.
4.3.2 Set the direction of text scrolling The direction attribute of the
tag is used to set the content scrolling direction. The attribute values ​​are left, right, up, and down, which represent left, right, up, and down respectively. For example, the following code:
Be kind and kind
Be kind and kind
Be kind and kind
Be kind and kind
4.3.3 Set the speed and form of text scrolling
To set text scrolling, use the tag. Its attributes are described below.
— The scrollamount attribute of the tag is used to set the content scrolling speed.
— The behavior attribute of the tag is used to set the content scrolling method. The default is scroll, which is cyclic scrolling. When its value is alternate, the content will scroll back and forth in a cyclical manner. When its value is slide, the content will stop scrolling once and will not loop. There is also a loop attribute to set the number of scrolling cycles, which defaults to no limit.
— The scrolldelay attribute of the tag is used to set the time interval for content scrolling.
— The bgcolor attribute of the tag is used to set the content scrolling background color (similar to the background color setting of the body).
— The width attribute of the tag is used to set the width of the content scrolling background.
— The height attribute of the tag is used to set the content scrolling background height.
Modify the mar.htm web page file and write the code as shown in code 4.16.

Code 4.16 Text scrolling settings: mar.htm



Text scrolling settings



Text scrolling example (default): Be kind
Example of text scrolling (to the right): Be kind
Text scrolling example (downward, scrolling mode is slide, speed is 10): Be kind and kind
Text scrolling example (default direction, scrolling mode is alternate, loops 3 times, speed is 2): Be kind and kind
Text scrolling example (up, background color is #CCFF66, background width and height are set): Be kind



Enter http://localhost/mar.htm in the browser address bar, and the browsing effect is as shown in Figure 4.16.

Figure 4.16 Different forms of text scrolling The many attributes of
make it very convenient to create scrolling text. In the following JavaScript learning, readers will continue to deepen the learning of the dynamic behavior of the tag.
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template