SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    stick google ad to the bottom

    Hello everyone,
    Take a look at this page:
    http://pet-pal.co.il/articles

    How can i make the google ad stick to the footer all the time?

    Note that content area can sometimes be bigger than the right side like on this page:
    http://pet-pal.co.il/orgs

    So i guess position absolute is not an option?

    Any suggestions?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,296
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    You could try adding something like this to your CSS:

    Code:
    #main {
      position: relative; 
      padding-bottom: 100px;
    }
    
    #bottomAd {
      position: absolute; 
      bottom: 0;
    }
    The bottom padding is needed to prevent overlap of ad and content when there's a lot of content in the main column.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    but your solution puts an extra 100px space on the #right div when its not needed.

  4. #4
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <snip> have a look on this page i also use adsense in the footer just open your root folder and go to wp-content then themes and after that choose whatever theme you want and after that just edit footer.php and add your ad sense code in the upper of all codes simple done.
    Last edited by TechnoBear; Oct 28, 2012 at 11:34. Reason: Link removed

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,296
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ulthane View Post
    but your solution puts an extra 100px space on the #right div when its not needed.
    If you find out how to keep your cake and eat it too, let me know!

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you find out how to keep your cake and eat it too, let me know!
    I could do that if i could manage making my #left element 100% height

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,296
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ulthane View Post
    I could do that if i could manage making my #left element 100% height
    Even if it were that tall, the ad would not go to the bottom by itself. I knew you wouldn't like the gap at the bottom, but it was the only reliable way I could think of.

  8. #8
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well I added margin-bottom:-100px to the #right element and it gave me the desired effect, but is it a good way to achieve it ?

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,296
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Seems to work OK. Good idea. (I've only tested it in one browser, though.)

  10. #10
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,475
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by ulthane View Post
    well I added margin-bottom:-100px to the #right element and it gave me the desired effect, but is it a good way to achieve it ?
    As long as the right column is always to the right of the ad then the negative margin will work fine as the right column will just get pulled into the extra padding that was added.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •