How to Align Adsense Ads Left or Right in Your Posts

December 29, 2009 · 9 comments

It is no secret that Adsense recommends larger ad units like the large rectangle. Using recommended Google Adsense sizes that are blended into your posts is likely to result in you receiving much more per click than you would with a smaller ad, on the same page, in the sidebar.

How to Float Adsense


To the right is an Adsense ad.
Notice it is not all smooshed up to the text.
The ad is a 300 x 250 large rectangle which is pretty big for my skinny little blog, but I figured I would show an example that even a large ad in a blogpost does not have to look hideous.
To make it further blend in (or at least be less ugly) I suggest you choose “image ads only” when creating your ad.
Here is the code to position those ads (it is just adding a “div”).
Add your Adsense code and then insert into your page or post.

<div style="margin: 5px; float: right;">
Put ad code here
</div>

The above code will work on Wordpress blogs, websites, just about anywhere. It also works with just about any type of ad too, not just Adsense.
You can also use padding to control the space between the ad and your text. The above code uses a margin. If you want more space between your ad and your text try changing the “5″ to “10″.
To make the ad go to the left, just replace “right” with “left”.

Related posts:
How To Make Google Gadgets – Lesson Two
LinkedIn and Widgets
SuperPages Affiliate Program is a Gadget

{ 9 comments… read them below or add one }

1 Xemytica January 6, 2010 at 1:42 am

That actually looks great. I had to read the blog post to understand that it was actually a ad-sense picture and not a picture that had something to do with the text! :) Great work.

I’m trying myself to fiddle with the SEO for my site (which is about collectible card games), and I haven’t dared touching AdSense for it. But I have some other sites with AdSense, and I’ll keep this in mind for them!

2 Truck Games January 7, 2010 at 12:10 pm

This actually very useful information for ad-sense newbies. And also helpful for blogger those who want to keep control over their ad orientations.

Thanks Buddy :d

3 mello yello January 10, 2010 at 9:54 pm

Thank you. I am going to use this info!

4 kariyerrusya January 31, 2010 at 12:58 pm

thank you for the code..

5 haberrus January 31, 2010 at 12:59 pm

useful thanks alot.

6 Pet Site January 31, 2010 at 11:07 pm

I’ve added the ad alignment on my site too. Thank you!

7 Bubbles Games February 21, 2010 at 10:34 pm

As a website manager, I’m always happy learning new stuff, basic or advanced, it’s a great post that would help lots of webmasters, thanks!

8 Simon March 1, 2010 at 8:07 am

For us Germans it can be useful too.. Spending time to find those things can be very borein.. Thank yoy

Simon

9 GaNda! March 10, 2010 at 2:27 am

Thanks alot for that one! really helped me.
I am just starting out with wordpress I am not good with Web stuff…
Great there are folk like you out there! :)

Leave a Comment

Do not spam please, if your name has keywords in it your comment will be deleted. Example: Your name shouldn't be "SEO Chicago", it should be "Sue" or "Bob".


Previous post:

Next post: