Monday, February 2, 2009
How to: Create Floating Advertisements
![]()
Merging advertisements with web content is often referred to as “floating ads”, “embedding ads”, and “blending in ads”. FlatPress makes it easy to embed images with content. To accomplish this with advertisements will take some HTML magic.
Wrapping web content around advertisements encourages visitors to read the advertisements. The more someone reads your ads, the more likely they will click on it. More clicks mean more revenue. The trick with adding advertisements is to not reduce the value of your web content. Floating ads offer a balance between web content and advertisement.
The sample code in this post was developed using “AdSense for Content” ad and link units. According to AdSense, the most successful ads are Large Rectangle (336×280), Medium Rectangle (300×250), and Wide Skyscraper (160×600). To view all types and sizes of AdSense advertisements visit this site.
The sample code below was used to create the floating shown above in this post. To use this code in your own post, replace the comment line in the middle with your AdSense code. The other comments lines are optional, they are included to help in switching the ad between the left and right sides of your post.
[html] <!-- float:left; padding: 0px 8px 8px 0px; --> <!-- float:right; padding: 0px 0px 8px 8px; --> <div style="float:right; padding: 0px 0px 8px 8px;"> <div style="width: 300px; height: 250px;"> <!-- Replace this line with the AdSense advertisement code --> </div> </div> [/html]
This code floats the ad to the right side of the content. To move the ad to left side of the post, change the float setting to “float:left; padding: 0px 8px 8px 0px;“. The width and height settings reflect the size of the ad, which in this case is a medium rectangle 300×250 ad. To prevent your web content from overlaying the ad, modify the width and height settings to that of your AdSense ad.
The new AdSense “Link Units” ads can be used as a floating ad. AdSense limits these ads to a maximum of three per web page. When combined with the “Ad Units” ads, you can have up to 6 AdSense ads per web page. Try to control yourself, visitors prefer content over advertisements.
Conclusion
Floating ads are a great method of combining ads with web content. The code used came from the post Float Ad in your content. I added some HTML tags to get it to work on FlatPress. The blog has many other posts on advertisements and developing web sites.
Additional Resources
- Float Ad in your content from How to NOT Make Money Online
- AdSense Help: Which ad format should I use?
- AdSense Help: Where should I place Google ads on my pages?
- AdSense ad samples of the various Formats.
- HOW TO MAKE A ADSENSE FRIENDLY WEBSITE from Dollarsbay.com. Shows a variety of ad placements.
Related Post
- How to: Add Adsense Ads to the Footer of each Post
- How to: Add Advertisements to the Sidebar (Blockparser)
- How to: Customize the Sidebar for FlatPress v.804
- How to: Add Google AdSense Search Form
- Google Webmaster Site Verification
Add comment
Fill out the form below to add your own comments


Tuesday, February 10, 2009 - 17:13:46
It looks very nice! Glad you were able to find the code useful.
Friday, February 13, 2009 - 20:10:09
Looks good. I will see about trying something like this.
Friday, June 5, 2009 - 02:00:54
it works for adsense