Place your message here

Your Guide to Professional
Web Site Design and Development

Web Development
HTML Codes
HTML Tips
Javascript Snippets
216 Safe Colors
Symbols
Web Directory
Web Resources
Internet Channels

Web Development: Business, Advertising, Internet Marketing, Promotion and Web Site Design

| Web Development | HTML Codes | HTML Tips | Javascript Snippets | 216 Safe Colors | Symbols | Recommendations |

Display Floating Ads within Your Web Page

By William Bontrager

With the internet public becoming more and more averse to in-your-face advertising, you'll probably want to implement this article with some good taste.

This article shows you how to put an image and/or text into the top-right corner of your web page. When the page is scrolled, your image/text stays in the top-right corner.

The demo page shows you how it works.

Geocities.com uses a similar idea to float their Yahoo image or other ads on their member's sites. Pages on sites whose hosting services preempt that space may not be able to use the code presented with this article.

The floating ad could be (as examples)


  • a small logo,

  • a link to a news item,

  • a text link to a special area of your site (such as "FAQ" or "Terms of Service"),

  • a "Click to Buy" button image linking to an order page,

  • an ezine subscription form,

  • an affiliate banner, or

  • a link that launches a popup window with additional content.

You'll think of other ways to use it.

The part that floats is placed between CSS <span...></span> tags. Thus, it can contain any HTML code.

Server Side Includes can be used between the <span...></span> tags, which means you can use Master Site News, Master Daily Content, or Master Merry-Go-Round to insert the floating content. (The Master Series of scripts are available here)

This is what you do:

(1) Retrieve the 27 lines of JavaScript from the demo page and place it in the <head></head> area of your page.

(2) Put onLoad="StartFloat()" into the <body... tag.

(3) Put these lines into the page content (<body></body>) area:

<span align="right" id="AdFloater" style="position: absolute; visibility: hidden; top: 1px;"> [CONTENT] </span>

(4) Replace [CONTENT] in the above lines with whatever you want to have float on your page.

That's all there's to it!

Done with good taste, it could be an asset to your site.


About the Author:

Copyright 2000 William Bontrager Programmer/Publisher, "WillMaster Possibilities" ezine mailto:possibilities@willmaster.com

Back