Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to move a text in HTML ?

  • Last Updated : 21 Jun, 2021

Some content of a website is like an alert or notification/information that has to be shown to each and every person who is using the website. It has to be placed at some point where everyone can see it.

In this article, we will learn how to create moving content on your website using HTML <marquee> tag. The <marquee> tag in HTML is used to create scrolling text or image in a webpages. It scrolls either from horizontally left to right or right to left, or vertically top to bottom or bottom to top.

Syntax:

<marquee> Contents... </marquee>

Approach:

  • Create a simple HTML file in any text editor.
  •  Add the text you want to move inside the <marquee> tag.

Example:

HTML




<!DOCTYPE html>
<html>
  
<body>
    <h2>Welcome To GFG</h2>
    <marquee> Lets Move this text.</marquee>
    <marquee direction="right" 
        behavior="alternate" 
        style="border:BLACK 2px SOLID">
        Geeks for Geeks
    </marquee>
</body>
  
</html>

Output:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!