The examples below demonstrates using the Marquee with different type of attributes. The code below demonstrates scrolling the text by using Marquee.
[html]
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee</title>
</head>
<body>
<marquee>Simple Programming Tutorials.</marquee>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrates the scroll text from right side by using direction attribute.
[html]
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee</title>
</head>
<body>
<marquee direction="right">Simple Programming Lessons</marquee>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrates scrolling the text from up by using the behavior and direction attributes is as shown.
[html]
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee</title>
</head>
<body>
<marquee behavior="scroll" direction="up">Simple Programming Lessons</marquee>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrates scrolling the text along with the image is as shown below.
[html]
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee</title>
</head>
<body>
<MARQUEE> Hi There! <IMG SRC="splessons.jpg" HEIGHT=33 WIDTH=82 ALT="splessons"> </MARQUEE>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrates the text bouncing by using the behavior attribute.
[html]
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee</title>
</head>
<body>
<marquee behavior="alternate">Simple Programming Lessons</marquee>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.
The code below demonstrates giving the background to the text.
[html]
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee</title>
</head>
<body>
<font color="WHITE"><marquee direction="left" style="background:RED">SPLessons</marquee></font>
</body>
</html>
[/html]
Result
By running the above code in a preferred browser user can get the following output as shown in below image.