1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

A little trick to put adsense within the text of your article

Discussion in 'Placement / Reviews / Examples' started by JamesColin, Dec 27, 2009.

  1. #1
    Hello, I just wrote a post on my little blog about a css trick I use sometimes when I want to put adsense or an image inside a text without having to do anything in PHP, it works for any raw text.

    You know you often see an adsense ad on the left of an article, and the text flows on the right and at the bottom of the adsense, it's made with css float:left this is a well known way to put adsense within the text because it works well for increase CTR.
    But what if you want the article to start with text above the adsense, then since you have the adsense on the left and the text then goes to the right of the adsense and then goes back below?

    You need to use a little css trick, in fact it is a small 1px width div that you set to float too, but the next div, with your adsense code, as a clear:left added, that will make the adsense goes below the first 1px width div. That way it will look like the adsense is below the beginning of the text, because you don't see the first 1px width div.

    Read on my blog for more details, with some explanation: http://blog-money-wiki.com/blog/200...le-trick-to-insert-an-image-within-a-text.php
    And then ask HERE if you need more information, don't post comments on my blog since I don't use it often, I just post from time to time.
     
    JamesColin, Dec 27, 2009 IP
  2. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #2
    I'd like to attach a screenshot to this post to show you the end result:
     

    Attached Files:

    JamesColin, Dec 28, 2009 IP
  3. deuterium

    deuterium Peon

    Messages:
    123
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, I use this as well, although, sometimes when I'm lazy, I just stick it into the style element of the div, without css files.
     
    deuterium, Dec 28, 2009 IP
  4. afunguy24

    afunguy24 Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'll try this out some time.
     
    afunguy24, Dec 28, 2009 IP
  5. zedomax

    zedomax Peon

    Messages:
    212
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Or you can use margin too.
     
    zedomax, Jan 2, 2010 IP
  6. deuterium

    deuterium Peon

    Messages:
    123
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I use style variables in my CMS :D
     
    deuterium, Jan 2, 2010 IP
  7. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #7
    No, I don't think you can use margins, because the text will not flow above. Can you confirm?
     
    JamesColin, Jan 2, 2010 IP