HTML Tutorial

HTML Marquee tag

 

The <marquee> tag is an HTML element that was used in earlier versions of HTML to create a scrolling or moving text or image within a web page. It was primarily employed to add dynamic and attention-grabbing effects to text or images. The content within the <marquee> tag would continuously move across the screen in the specified direction.

In HTML, the <marquee> tag is used to create a scrolling or moving text or image. However, it’s important to note that the <marquee> tag is considered deprecated in HTML5, and its usage is discouraged. Instead, you should use CSS animations or other modern techniques for creating similar effects.

Here’s an example of how you can use the <marquee> tag:

<!DOCTYPE html>

<html >

<head>

  <title>Marquee Example</title>

</head>

<body>

<marquee behavior=”scroll” direction=”left”>This text will scroll from right to left.</marquee>

</body>

</html>

In this example:

behavior=”scroll” specifies that the content will scroll.

direction=”left” specifies the direction of the scroll (you can use “right”, “up”, or “down” as well).

Again, using the <marquee> tag is not recommended for modern web development. Instead, consider using CSS animations for a more flexible and maintainable approach.

Marquee tag attributes

If you still need information about the attributes of the <marquee> tag , here they are:

1.behavior: Specifies the scrolling behavior. Possible values include:

scroll: Text or image scrolls from one side to another.

slide: Text or image slides in and out of view.

alternate: Text or image scrolls back and forth.

Syntax:

<marquee behavior=”scroll”>This text will scroll.</marquee>

2.direction: Specifies the direction of the scrolling. Possible values include:

left: Scrolls the content (text or img)from right to left.

right: Scrolls the content from left to right.

up: Scrolls the content(text or img) from bottom to top.

down: Scrolls the content from top to bottom.

Syntax:

<marquee direction=”left”>This text will scroll from right to left.</marquee>

3. scrollamount: Specifies the scrolling speed in pixels. Higher values mean faster scrolling.

Syntax:

<marquee scrollamount=”5″>This text will scroll slowly.</marquee>

4. scrolldelay: Specifies the delay between each scroll movement in milliseconds.

Syntax:

<marquee scrolldelay=”1000″>This text will have a delay of 1 second between scrolls.</marquee>

5. width: Specifies the width of the marquee.

Syntax:

<marquee width=”50%”>This text will have a width of 50% of the container.</marquee>

6. height: Specifies the height of the marquee.

Syntax:

<marquee height=”100″>This text will have a height of 100 pixels.</marquee>

Marquee tag in HTML EXAMPLE

<html>

<head>

<title>usage of margin</title>

</head>

<body bgcolor=”pink” text=”green”>

<marquee direction=”center” behavior=”scroll” scrollamount=”5″>

 <font size=”+8″><i align=”center”>In HTML, the marquee tag is used to create a scrolling or moving text or image.

</marquee>

<marquee>

<img src=”aa.jpg” height=50 width=50>

</marquee>

</body>

</html>

Marquee Tag in HTML

Recommended Posts

C++ Programming

Visibility modes in C++

In C++, visibility modes refer to the accessibility of class members (such as variables and functions) from different parts of a program. C++ provides three visibility modes: public, private, and protected. These modes control the access levels of class members concerning the outside world and derived classes. Public: Members declared as public are accessible from […]

Rekha Setia 
C++ Programming

Inheritance in C++

In C++, inheritance is a fundamental concept of object-oriented programming (OOP) that allows you to create a new class based on an existing class, known as the base or parent class. The new class is called the derived or child class. Inheritance facilitates code reuse and supports the creation of a hierarchy of classes. There […]

Rekha Setia 
C++ Programming

C++ Classes and Objects

In C++, classes and objects are fundamental concepts that support object-oriented programming (OOP). Here’s a brief overview of classes and objects in C++: Classes: In C++, a class is a user-defined data type that allows you to encapsulate data members and member functions into a single unit. Classes are the building blocks of object-oriented programming […]

Rekha Setia 

Leave A Comment