Getting content to wrap around AdSense code?

Discussion in 'HTML & Website Design' started by sri, May 18, 2007.

  1. #1
    How do I wrap the content around the ad? (Kindly chk the attachment)

    I am using AdSense plugin for WordPress.
     

    Attached Files:

    sri, May 18, 2007 IP
    smartgirl likes this.
  2. BlackCoder

    BlackCoder Peon

    Messages:
    529
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
  3. dlcmh

    dlcmh Peon

    Messages:
    232
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You'll need to put the Adsense code inside a <div> and float it to the left, like this:

    <div style="float:left;">
    --adsense code goes here--
    </div>
    Continue your blog post blah blah blah

    Or, if you want to put the styling inside the stylesheet, do this:

    1. Locate the stylesheet for your Wordpress theme, say styles.css

    2. Create two new classes in the styles.css file, say:

    .adsleft {
    float: left;
    }

    .adsright {
    float: right;
    }

    3. Then, in your Wordpress template or post, enter this:

    <div class="adsleft">---adsense code---</div> (if you want to float the adsense unit left)
    Blah blah blah post &/or php code

    <div class="adsright">---adsense code---</div> (if you want to float the adsense unit left)
    Blah blah blah post &/or php code

    Hope this helps. Do ask if you need more clarification.
     
    dlcmh, May 18, 2007 IP
  4. sri

    sri Active Member

    Messages:
    917
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Thanks dlcmh. That did the trick.
     
    sri, May 18, 2007 IP