Share this Page URL

Making Your Web Pages Dance and Sing 125 Webmaster Wisdom The <MARQUEE> tag is supported only by Internet Explorer, so it doesn't work in Netscape or any other browser. If you want scrolling text that works in most browsers, you can use JavaScript, as described in Chapter 17, "The Programmable Page: Adding JavaScripts to Your Pages." The text you cram between the <MARQUEE> and </MARQUEE> tags is what scrolls across the screen. To gain a little more control over the scrolling, the <MARQUEE> tag supports quite a few attributes. Here are a the most useful ones: · ALIGN=" Alignment "--Determines how the surrounding text is aligned vertically with the mar- quee. For Alignment, use either TOP or BOTTOM. · BEHAVIOR=" Type "--Determines how the text behaves within the marquee. For Type , use SCROLL to get the standard scroll-across movement; use SLIDE to make the text scroll in and then stop when it reaches the opposite side; use ALTERNATE to make the text "bounce" back and forth within the marquee. · BGCOLOR=" Color "--Sets the color of the marquee background. · DIRECTION=" WhichWay "--This attribute tells the browser which way to scroll the text. Which- Way can be either LEFT or RIGHT. · LOOP=""-- Times This attribute specifies the number of times you want the text to scroll. If you set Times to INFINITE or ­1, the text will scroll until kingdom come. · SCROLLDELAY=""-- Time This attribute sets the delay in milliseconds between each loop. · SCROLLAMOUNT=" Pixels "--This attribute determines how many pixels the text jumps with each iteration. The higher the value for Pixels , the faster the text scrolls. · HEIGHT=" Value "--Specifies the marquee height either in pixels or as a percentage of the screen. · WIDTH=" Value "--Specifies the marquee width either in pixels or as a percentage of the screen. Here's an HTML file (look for marquee.htm on this book's CD) that uses several of these attributes. Figure 11.3 shows how it looks in Internet Explorer. (When Netscape users view this page, they see all of the text between <MARQUEE> and </MARQUEE> at once.) <HTML> <HEAD> <TITLE>Marquee Malarkey</TITLE> </HEAD> <BODY> Welcome Web<MARQUEE ALIGN="BOTTOM" BGCOLOR="SILVER" WIDTH="50" SCROLLAMOUNT="4"> maker..........master..........meister.......... spinner..........weaver..........welder.......... </MARQUEE>! </BODY> </HTML>