Code Snippets

  

HTML/CSS Source Code


Welcome to Dream.In.Code
Become an Expert!

Join 149,630 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,061 people online right now. Registration is fast and FREE... Join Now!





Floating Ad Banner at Bottom of Screen

This is the code I'm using to display the fixed position banner at the bottom of the browser window. This is also referred to as the "catfish" banner on SitePoint. Credit for the CSS goes to howtocreate.co.uk and the original code can be found here: http://www.howtocreate.co.uk/fixedPosition.html

Submitted By: skyhawk133
Actions:
Rating:
Views: 21,798

Language: HTML/CSS

Last Modified: April 11, 2006
Instructions: Just paste this in your page.

Snippet


  1. <!-- Original Code: http://www.howtocreate.co.uk/fixedPosition.html -->
  2. <!-- Snippet With Example: http://code.dreamincode.net/snippet370.htm -->
  3.  
  4. <!-- CSS with support for IE -->
  5. <style type="text/css">
  6.  
  7. <!--
  8. #fixme {
  9.      /* IE 5.0/Win and other lesser browsers will use this */
  10.      position: absolute; right: 0px; bottom: 0px;
  11.  
  12. }
  13. body > div#fixme {
  14.      /* used by Netscape6+/Mozilla, Opera 5+, Konqueror, Safari, OmniWeb 4.5+, ICEbrowser */
  15.      position: fixed;
  16. }
  17. --></style>
  18. <!--[if gte IE 5.5]>
  19. <![if lt IE 7]>
  20. <style type="text/css">
  21. div#fixme {
  22.      /* IE5.5+/Win - this is more specific than the IE 5.0 version */
  23.      right: auto; bottom: auto;
  24.      left: expression( ( -0 - fixme.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
  25.      top: expression( ( +0 - fixme.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
  26. }
  27. </style>
  28. <![endif]>
  29. <![endif]-->
  30.  
  31. <!-- HTML CODE FOR ACTUAL BANNER -->
  32. <div id="fixme" style="height: 120px; width: 100%;">
  33.    <!-- EDIT BANNER CONTENTS BELOW -->
  34.    <div style="z-index: 5; background: url(http://home.dreamincode.net/images/catfish/catfish_tile2.gif); width: 100%; height: 120px;">
  35.       <div style="float: left; position: relative; left: 0; top: 0;"><a href="http://forums.dreamincode.net/showtopic14671.htm"><img src="http://home.dreamincode.net/images/catfish/catfish2.gif" height="120" border="0"></a></div>
  36.       <div style="float: right; position: relative; text-align: right; top: 75px; font-size: 10px; font-weight: bold;"><a onClick="hiderow('fixme');return true;" style="cursor: pointer;">Close Me</a></div>
  37.       <div style="float: left; position: relative; top: 80px; text-align: center; font-size: 12px; font-weight: bold; font-style: italic;"><a href="http://forums.dreamincode.net/showtopic14671.htm">Celebrate 5 Years of Dream.In.Code:<br>Win a Laser Engraved IPod Nano & Caffeine!</a></div>
  38.    </div>
  39. </div>
  40.  

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.




Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month