How To Move Text In HTML
Last Updated : Jan 1, 2023
IN - HTML
In this tutorial we will show you the solution of how to move text in HTML, in HTML, there are many ways with the help of which you are able to make a creative website and one from them is move text in html.
But, we will show you how you able to move your text using html tags only. And the name of the tag which we use is marquee tag.
Step By Step Guide On How To Move Text In HTML :-
As, we already specify there are many ways with the help of which you are able to move text in html. But here we choose the suitable way from every side and with the help of html tags only.
So, in this topic the text will be move using marquee tag. Whereas in marquee tag there are also many attribute which are used which help you to choose direction, means in which direction the text move.
With the help of attributes you can handle the speed of text, scroll amounts and many other things which you understand in our next session.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <marquee> Their is no any direction given to text </marquee> <marquee direction="right"> The text moves in right direction</marquee> <marquee direction="down"> the text moves in down direction</marquee> <marquee direction="up">the text moves in upper direction</marquee> </body> </html>
- First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
- Secondly, the <html> tag is used to indicate the beginning of an HTML document.
- As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
- Thirdly, <body> tag is used to define the webpage body. All the contents to show on website are written here. Hence, here is body we create directly marquee tag, if you want to create this tag under some tag, then you can also do this.
- After this, in first marquee, you see that there is no any direction given. It means that by default the text moves to left direction.
- In next marquees, we found that here we describe some location, so using that attributes the tags moves in respective direction. You can also specify the width and height of marquee tags to move them in specific dimensions.
- At last, the <body> and <html> tags are closed with </body> and </html> respectively.
At last, here you see how to move text in html in any direction. There are many other attribute that are used under marquee, we also show you them.
That what are they and how they work. I hope this tutorial on how to move text in HTML helps you.