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

Sep 04, 2018 am 11:56 AM
html marquee

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.

1

2

3

4

5

<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:

1

2

3

4

<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:

1

2

3

4

<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: http://www.php.cn/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!

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

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles