Home > Web Front-end > HTML Tutorial > How to scroll up and down in html marquee tags, and set the scrolling speed of marquee tags

How to scroll up and down in html marquee tags, and set the scrolling speed of marquee tags

寻∝梦
Release: 2018-09-04 11:56:50
Original
10742 people have browsed it

This article mainly introduces you to the two usages of html marquee tags. One is to make the text in the marquee tag scroll up and down, and the other is to make the text in the marquee tag scroll faster or slower. You can also combine the two and use them together. Now let us look at this article together

First let us get to know this html marquee tag:

This marquee tag has been specially written about some of its usage and Attribute, you can click on itWhat is the code of the scroll bar in html? How to set html scroll bar? have a look.

tags are tags that appear in pairs. The content between the first tag and the last tag is the scrolling content. The attributes of the tag mainly include behavior, bgcolor, direction, width, height, hspace, vspace, loop, scrollamount, scrolldelay, etc. They are all optional.

Now look at how the marquee tag implements up and down scrolling:

html The behavior attribute of the marquee tag:

behavior attribute The parameter value is one of alternate, scroll, and slide, which respectively means that the text scrolls back and forth, one-way circular scrolling, and only scrolls once. It should be noted that if the direction and behavior attributes appear in the tag at the same time, then The scrolling direction of scroll and slide will be based on the setting of the parameter in the direction attribute.

<marquee behavior="alternate">我来回滚动</marquee>
<marquee behavior="scroll">我单方向循环滚动</marquee>
<marquee behavior="scroll" direction="up" height="30">我改单方向向上循环滚动</marquee> 
<marquee behavior="slide">我只滚动一次</marquee>
<marquee behavior="slide" direction="up">我改向上只滚动一次了</marquee>
Copy after login

bgcolor attribute is the background color of the text scrolling range. The parameter value is hexadecimal (form: #AABBCC or #AA5566, etc.) or a predefined color name (such as red, yellow, blue, etc.). As shown below:My background color is red

There is also html marquee The direction attribute of the label:

The direction of text scrolling. The parameter values ​​of the attribute include four single optional values: down, left, right, and up, which represent the scrolling direction downward, left, and up respectively. Right, up. As shown below:

<marquee direction="right">我向右滚动</marquee>
<marquee direction="left">我向左滚动</marquee>
<marquee direction="down">我向下滚动</marquee>
<marquee direction="up">我向上滚动</marquee>
Copy after login

Mainly the last two are the up and down scrolling introduced in this article. Setting this can make the text inside scroll up and down.

Now let’s talk about the scrolling speed of the marquee tag:

What is the scrolling speed of this html marquee tag? Can anyone guess. . .

Well, let me tell you what I mean, it’s the scrollamount and scrolldelay properties:

These two properties determine the text scrolling speed (scrollamount) and delay (scrolldelay ), the parameter values ​​are all positive integers. As shown below:

<marquee scrollamount="100">我速度很快.</marquee>
<marquee scrollamount="50">我慢了些。</marquee>
<marquee scrolldelay="30">我小步前进。</marquee>
<marquee scrolldelay="1000" scrollamount="100">我大步前进。</marquee>
Copy after login

You can set specific numbers. You can go as fast as you want and as slow as you want. Isn't it interesting? But because they are all animated pictures, it is difficult to take screenshots. I recommend a website that can be copied directly to achieve the effect: //m.sbmmt.com/code/26516.html. Just copy the above code. You can see the effect when you go in. You can give it a try.

Okay, here are the two uses of the html marquee tag in this article. If you have any questions, you can ask below.

【Editor's Recommendation】

What is the code for the scroll bar in html? How to set html scroll bar?

#html5 How to use the progress tag? Introduction to the attributes of the progress tag

The above is the detailed content of How to scroll up and down in html marquee tags, and set the scrolling speed of marquee tags. For more information, please follow other related articles on the PHP Chinese website!

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