Two Adsense Ads On One Line: With Different Alignments

Discussion in 'HTML & Website Design' started by barrow, Jul 6, 2007.

  1. #1
    Hello,
    If you look at the main index of http://www.jasonbarrow.com you will see that I have an Adsense image ad and and Adsense text ad sitting next to each other. I'm doing this right now simply like this:

    
    <div align="center">
    ADSENSE_CODE_1
    ADSENSE_CODE_2
    </div
    
    Code (markup):
    I think it looks awkward in the center though so I would like the left ad to be aligned to the left, and the right ad to be aligned to the right.

    I've tried this:
    
    <div align="left">
    ADSENSE_CODE_1
    </div>
    <div align="right">
    ADSENSE_CODE_2
    </div>
    
    Code (markup):
    This fixes my alignment problem but puts the 2nd ad below the first ad. Is there a way that I can have them on the same line but aligned to the left and the right with the empty space in the middle?

    Any will thankfully be taken.
     
    barrow, Jul 6, 2007 IP
  2. JOGS_DEV

    JOGS_DEV Peon

    Messages:
    136
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    <div style="float:left;">
    ADSENSE_CODE_1
    </div>
    <div style="float:right;">
    ADSENSE_CODE_2
    </div>
    Code (markup):
     
    JOGS_DEV, Jul 7, 2007 IP
    barrow likes this.
  3. barrow

    barrow Peon

    Messages:
    135
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Jogs! That worked. I did have to add the following after the div though or else my blog post headers were starting to go in the middle of the Adsense ads.
    <br clear="left" />  
    Code (markup):
    Green rep sent!
     
    barrow, Jul 7, 2007 IP
  4. drewtoby

    drewtoby Well-Known Member

    Messages:
    763
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Thanks, your advice helped me too!
     
    drewtoby, Mar 22, 2011 IP