Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make scrolling text with HTML code

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "HTML code how to make scrolling text", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "HTML code how to make scrolling text" bar!

1 set text scrolling

The way to scroll text in HTML technology is to use double tags. In the HTML code, you can make the text scroll in its scope, which defaults to right-to-left, 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 honest

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

As you can see from figure 4.15, when the width is not set, the label has an exclusive line.

2 set the direction of text scrolling

The direction attribute of the tag is used to set the scrolling direction of the content. The attribute values are left, right, up, and down, which represent left, right, up, and down, respectively, such as the following code:

Be a good man.

Be a good man.

Be a good man.

Be a good man.

3 set the speed and form of text scrolling

Set the text scroll to use the label, and its attributes are described below.

-the scrollamount property of the tag is used to set the scrolling speed of the content.

-the behavior attribute of the tag is used to set the content scrolling method. The default is scroll, that is, circular scrolling. When its value is alternate, the content will cycle back and forth. When its value is slide, the content scrolls once and then stops and does not cycle. There is also a loop property that sets the number of scrolling cycles, which is unlimited by default.

-the scrolldelay property of the tag is used to set the time interval for content scrolling.

-the bgcolor property of the tag is used to set the content scrolling background color (similar to the background color setting of body).

-the width property of the tag is used to set the content scrolling background width.

-the height property 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 example (default): text scrolling example to be honest (right): text scrolling example to be honest (downward, scrolling mode is slide, speed is 10): text scrolling example to be honest (default direction, scrolling mode is alternate, cycle 3 times, speed is 2): to be honest text scrolling example (up, background color is # CCFF66) Set the background width and height): be honest.

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

The performance of many genera is very convenient to make scrolling text, in the following JavaScript learning, readers will continue to deepen the dynamic behavior learning of tags.

Thank you for your reading, the above is the content of "how to make scrolling text in HTML code". After the study of this article, I believe you have a deeper understanding of how to make scrolling text in HTML code. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report