Categories


HTML: Creating a Marquee

If you want to have a marquee on your page without using JAVA, try using the following HTML code to insert a scrolling marquee anywhere on your web page. Your marquee can be words, sentences, or even images. The information contained in your marquee code will start at one point (on the screen) and float across much like the advertising marquees you see at some businesses.

Marquee Code for our sample text:

This is a sample marquee scroll

To see this code in action, visit this link…. Marquee

For our sample, we’ve coded our text to scroll across 85% of the screen with a height of 15 (pixels). We’ve set our delay at 175 milliseconds; our direction to scroll is ‘left‘ and we want our loop to be ‘infinite‘.   Note: You can use marquee code inside of tables also.

Marquee Attributes

Width and Height – you can assign width and height to your marquee area as either a percentage of the area where the marquee is to display or in pixels. In our sample we’ve used a percentage for the width and a pixel designation for the height.

Scroll Delay – use this attribute to control the amount of time (in milliseconds) that passes before the text scrolls again.

Behavior – allows you to select the type of movement you want to use:

Scroll – use this for text that starts at one side of the screen and disappears off the other side.

Slide – use this for text that starts at one side and stops when it reaches the other side.

Alternate – use this for text that starts at one side and bounces back when it reaches the other side.

Direction – this determines the direction the text starts from (left or right).

Loop – allows you to select the number of times the marquee is to pass across the screen. You can also make the text appear continuously by using ‘infinite’ in place of a number.

Other – additional placement and attributes of the marquee can also be controlled by using the following attributes as well. This information is contained in the first tag.

HSPACE (Horizontal space)

VSPACE (Vertical Space)

ALIGN  (Align – left, right, center)

BGCOLOR  (Background color)

Marquee Content

This code is placed between the beginning and ending marquee tags  HTML Code for Content Goes Here

Images – If you want to use images inside the scroll, keep them as small and as few as possible.

Font – color, face and size: use the same code you would use anywhere else in your HTML docuement to control how the text displays.

A scrolling marquee can be used to highlight a specific section of a page, draw attention to a special offer or display a larger quantity of information that you might think you have space for. Hope you have fun using this bit of code.

Comments are closed.