In this post I am going to explain how you can add Scrolling text (also known as marquee) to the sidebars, post, etc. of your Blogger blog.
Another way to attract visitors to your blog or some of ist pages is adding some decoration to like scrolling text,etc. But do not overdo this, especially if your site contains a lot of of text as this irritates and spoils the concentration of the reader.You can add scroll bars to tell your visitors what will be your next updates, popular posts, advertisements, etc. Scrolling text works especially good for headlines.
How to add scrolling text to your blog
1. Adding simple scrolling text:
Here is the code to add a simple scrolling text that moves from right to left:
<marquee>code to simple scrolling text</marquee>
The output will look like this:
If you want something a bit more fanciful, then try this:
2. Add a background color to the text:
<marquee bgcolor="#99CCFF">code to simple scrolling text</marquee>
You can easily choose your background colour by replacing the hexadecimal code (#99ccff).
Click here to see the codes of the different colors or create your own.
3. Here are some more attributes to you can change:
direction="left"
direction="right"
direction="up"
direction="down"
The above attributes tell the text in which direction to scroll.
Use the code below:
<marquee direction="right" bgcolor="#99CCFF">code to simple scrolling text</marquee>
Here are some examples:
Scrolling to the right:
Scrolling up:
Scrolling downwards:(Note: I changed the hexa decimal codes for different colours)
4. And a few more attributes:
You can add this attribute to alternate the text:
behavior="alternate"
Here is the code to do this:
<marquee behavior="alternate" direction="down" bgcolor="#33FFCC">code to simple scrolling text</marquee>
You can also set the speed of the text with this simple attribute:
scrollamount="2"
The lower the scrollamount value, the slower it moves.
Here is the HTML code for this:
<marquee
behavior="alternate" direction="left" bgcolor="#9999CC"
scrollamount="2">code to simple scrolling text</marquee>
(scrollamount =2):
(scrollamount=5):
5. Pausing the text when mouse hovers over the text:
This is very useful when the reader wants to read the text, and the scrollamount is high. Readers can put the mouse over the text to pause the text to read it.
Here is the code:
<marquee behavior="alternate" direction="left" bgcolor="#CCCCCC"
onmouseover="this.stop()" onmouseout="this.start()" scrollamount="2"
scrolldelay="50"> code to simple scrolling text</marquee>
(place the mouse over the text to test it)
6. Changing the text colour:
Here is the code to change the text colour (Add it before the marquee tag):
<span style="#FFFFFF">
So, the code looks like this:
<span><marquee
onmouseover="this.stop()" onmouseout="this.start()" scrollamount="4"
bgcolor="#cccccc"><br /><br />code to simple scrolling
text<br /><br /></marquee>
7. Here is the most important and most useful one, adding hyperlinks in the scrolling text.
Hyperlinks are links that, when clicked, take you to another location (site).
Let's see how to add hyperlinks to the scrolling text. Adding hyperlinks that open in the same window:
Here is the sample code:
<marquee behavior="scroll" direction="left" bgcolor="#99FFFF"
onmouseover="this.stop()" onmouseout="this.start()" scrollamount="4">
<a href="url#1">LINK#1</a> <a
href="url#2">LINK#2</a> <a href="url#3">LINK#3</a>
</marquee>
NOTE:Replace the Link#1,Link#2,Link#3 with the text and url#1,url#2 and url#3 with the target url addresses.
If you want the links to open in new window, use the following code:
<marquee behavior="scroll" direction="left" bgcolor="#99FFFF"
onmouseover="this.stop()" onmouseout="this.start()" scrollamount="4">
<a href="url#1">LINK#1</a> <a
href="url#2">LINK#2</a> <a href="url#3">LINK#3</a>
</marquee>
That's all!
Now you can add the scrolling text of your choice to the sidebar, in the blog post, or where ever you want it to appear.
To put scrolling text in the sidebar of your Blogger blog, simply sign in to your Blogger account --> Dashboard --> Design --> Add page element. Then paste the code in HTML/JavaScript and save the changes .
If you have any questions, please leave a comment.
Good luck!