Webpage HTML code: rolling text creation _ HTML/Xhtml _ webpage Creation
Source: Internet
Author: User
In this section, I will introduce some special tags in HTML code, which can scroll the text on the webpage and control its scrolling attributes. After learning this chapter, you can control the display methods of text in different sections. However, no matter how you set it, the text is static. In this section, I will introduce some special tags in HTML code, which can scroll the text in the webpage and control its scrolling attributes.
Create scroll text
Through the previous study in this chapter, readers have been able to control the display methods of various paragraphs and texts. However, no matter how you set them, the text is static. In this section, I will introduce some special tags in HTML code, which can scroll the text on the webpage and control its scrolling attributes.
4.3.1 set text scrolling In HTML technology, double tags are used to scroll text. . In HTML code, you can scroll the text in the target area. The default value is from right to left, and the text is cyclically rolled. Create a webpage file under D: \ web \ directory and name it mar.htm. Write the code as shown in code 4.15.
Code 4.15 text scroll setting: mar.htm
Text scrolling settings
Text scroll example (default ): Be honest
Enter http: // localhost/mar.htm in the address bar of the browser. The browser effect is 4.15.
. 15 set the default text scrolling format
Available in. 15. When no width is set, A tag exclusive to a row.
4.3.2 set the direction of text scrolling The direction attribute of a tag is used to set the content scrolling direction. The attribute values include left, right, up, and down, which respectively indicate left, right, up, and down. For example, the following code:
Be honest
Be honest
Be honest
Be honest
4.3.3 set the speed and format of text scrolling Set text scrolling Label. Its Attributes are described as follows.
- The scrollamount attribute of the label is used to set the content scroll speed.
- The behavior attribute of the label is used to set the content scrolling mode. The default value is scroll, that is, loop scrolling. When the value is alternate, the content will be rolled back cyclically. When its value is slide, the content is rolled once to stop without repeating. You can also set the number of scrolling cycles for the loop attribute. The default value is no limit.
- The scrolldelay attribute of the label is used to set the time interval for content scrolling.
- The bgcolor attribute of the label is used to set the scrolling background color of the content (similar to the background color setting of the body ).
- The width attribute of the label is used to set the width of the scrolling background of the content.
- The label height attribute is used to set the background height for content scrolling.
Modify the mar.htm webpage file and write code, as shown in code 4.16.
Code 4.16 text scroll setting: mar.htm
Text scrolling settings
Text scroll example (default ): Be honest
Text scroll example (to the right ): Be honest
Text scroll example (downward, scroll in slide mode, speed is 10 ): Be honest
Text scroll example (default direction, scroll mode is alternate, loop 3 times, speed is 2 ): Be honest
Text scroll example (up, the background color is # CCFF66, and the background width and height are set ): Be honest
Enter http: // localhost/mar.htm in the address bar of the browser. The browser effect is 4.16.
. 16 different forms of text scrolling
You can easily create scrolling text with many attributes. In the subsequent JavaScript learning, readers will continue to deepen Dynamic Behavior Learning of tags.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.