SiteExperts.com Logo Home | Community | Developer's Paradise | Jobs
User Groups | Site Tools | Site Information | Search

Inside Technique : Dynamic HTML Ads : Converting to an Ad

To convert the test code to a real ad, the DIV element surrounding the advertisement needs to be removed and its definition transfered to the BODY element.

  <BODY>
    <DIV ID=ad STYLE="position: relative; cursor: hand; width: 468; height: 60; border: 1pt black solid">

Becomes...

  <BODY ID=ad>

The position: relative is removed because that is implied by the body element, and the border is optionally removed as most banner ad consumers define the border on behalf of the ad. To include this advertisement on the page, an object is defined similar to defining an image:

<OBJECT CLASS=ad DATA="follow.htm" TYPE="text/x-scriptlet" WIDTH=468 HEIGHT=60></OBJECT>

To define the default border around the ad, we use a style sheet in the document consuming the ad:

<STYLE>
  .ad {border: 1pt black solid}
</STYLE>

Last we demonstrate a technique for making your ads more interactive by tracking the mouse.