How to wrap text around Google Adsense or an image

 Filed As:Adsense, Blogging, Tips
 ADVERTISEMENTS

 

I have been experimenting with image and ad placement these days. When I tried to put ad block in a post and tried to warp post content around it… man it did not work.

But with little research and Googling around, was able to do so in few minutes. I am sure some of you, want to know how? In fact, it is very easy, for both image and AdSense block one has to use different tags.


Warp Text around an Image:
1. Make sure your image size in not bigger than the post column width.
2. After you save and upload image to your server, get the hyperlink for that and then add the following code for the placement.

<img align=”left” src=”IMAGE URL/ADDRESS” width=”120″ height=”130″></a>

For placement on right change ‘align’ value to right. In case you want to add hyperlink and other values to the image being played around with, then use following code with lot of other variables:

<a target=”_blank” style=”text-decoration: none; color: #8B31C7″ href=”URL OF THE WEBPAGE“><img align=”left” style=”border-left: 14px solid #FFFFFF; border-right: 14px solid #FFFFFF; border-top: 4px solid #FFFFFF; border-bottom: 4px solid #FFFFFF” src=”URL OF IMAGE SOURCE” width=”120″ height=”130″></a>


Wrap Text around a Google AdSense or any other Ad block:
1. First get the ad code from your AdSense account or control panel.
2. Then just insert the following code, with your actual ad code.

<div style=”display:block;float:right;margin: 5px 5px 5px 5px;”> Google or any other AD  code</div>

To play around with ad placement you change the ‘float’ value to left, right and center as per requirement. 5px 5px 5px 5px is margin spacing top, right, bottom and left respectively.

Result of this should be like following:
Image is left aligned, while Google ad on the right. Snapshot via Nazaraone


Tags:
By Davinder on Sunday, July 15th, 2007

Share & Spread: Digg | Delicious | Share |


▼ Comments

16 Responses to “How to wrap text around Google Adsense or an image”
  1. Gail Cavanaugh says:

    Thanks, you’re a life saver! I am not a programmer and would neve have know what to do.

  2. MIKE says:

    good stuff!!! google should allow you to alter the outer script code cos it doesnt affect the ad in any way just the position.

  3. Hari says:

    Thank you very much. Your code helped me a lot.

  4. Joy says:

    I was having the same issue with adense images, I couldn’t get the text to wrap. I finally threw the code in a table and aligned the table to the left. I know most people try to avoid tables…as do I. I try to stick mainly with css but this was an easy quick fix.

  5. peter says:

    Thanks man!!!! Wonderful

  6. matty says:

    very cool…easy to implement. thanks mate.

  7. Tom says:

    Thanks for the tagging. Displayed great on both Firefox 3.0 and IE6.

    I don’t understand why Google does not have this information in the resource area for adsense publishers. If they do, I was unable to ever find it.

  8. Robert Palmer says:

    I’m not up to date on my programming languages and I spent hours looking for a way to do this. All of the results I found involved wordpress plugins and yards of code. This is by far the simplest and most precise way to do this.

    Thank you

  9. Make Money Not Excuses says:

    Thanks for the tutorial. I been looking for a code that works for a couple of days now and yours is the only one that seems to work for me.

  10. Davinder says:

    @Ariel
    Text spacing wont be affected, if you paste the code in template.

  11. Ariel says:

    Excellent! It works. I have a question though, How can I paste it without modifying the type space that surrounds the ad?
    Thank you

  12. kelly says:

    hey, thank you….sometimes this website stuff can be very frustrating – thanks for making it that little bit easier!

  13. Rachel Goldstein says:

    This worked so well. This was a huge help.
    Thank you!

    Rachel

  14. PT says:

    Thanks. Very helpful code.

  15. cinophile says:

    thanks man , really helpfull to me & im sure to many people out there.

▼ Add a Comment