December 11, 2006

Google Adsense ads besides posts in Blogger

Today I came across a post by Deniz illustrating how to put Google Adsense ads besides your posts in Blogger. The method makes use of tables to align the ads to the left. But why use tables when you can use CSS to make Adsense ads appear besides your posts easily. Also by using the CSS method you can make Google Adsense ads appear on either the left side of your post content or right side of your post content which is not possible in case of tables.

So here is a CSS method to put Adsense ads besides your posts.

The CSS code

Open your blog's template in the template editor and add the following code. Simply paste the code into the stylesheet, before the
]]></b:skin> tag in your template.

.adv
{
float:left;
padding-right:10px;
padding-right:10px;
}
The above code aligns your ads to the left. If you want to align your ads to the right simple use float:right in the third line.

Changes in the Adsense code

Now grab the Adsense code of your favorite format and before pasting it in your template just make a small change in the code. Wrap the code in the tags <div class='adv'> and </div>


For example,


<div class='adv'>

Your adsense code

</div>


That's it, your adsense ads will now appear besides your posts.

In case you need any help, feel free to contact me.smile_regular

16 comments ↓

Angad said...

You mean float: right; in the third line/ :)
Great info for those who don't know css!
Good job!


Manas said...

Thanks for pointing out the mistake.. ;)


Jason said...

the ads only appear on the main page. They also appear when I select catagories, but if I click on older posts (a link I would like to remove) the ads do not display. Why?


Manas said...

Can I see your blog ?

That would help in understanding your problem.


mangamaniac said...

why at my blog it doesnt work

btw my blog ii
http://mangacentral.blogspot.com

thx


Manas T said...

Mangamaniac, I see that you are using Deniz's method. So you better ask this question in his blog. :)


Berkay Dinçer said...

Thanks! It seems great for the new blogger. But I prefer to use old blogger in some of my blogs in which I used a lot of html changes and for that I don't want to upgrade to new blogger.


Anonymous said...

Hello,
The tip didn't work as you suggested, but i made it work after a little tweak on google ads code after creating the CSS code that you have suggested.
You need to replate (!-- and //--) with (<!-- and //-->)
Then it will work.
REPLACE () WITH <> THEN AGAIN () WITH blank
Thanks for the post.
Best Regards
Eliena Andrews http://healthtreatments.blogspot.com


Basketer said...

The div tag doesnt seem to work in the new blogger. My ads show up just right but the problem is that all the text in my posts disappears


Reda said...

hey i think editing ur adsense ADs. will make google adsense BAN U . so am i right or wrong ????????????


aditya said...

not working on my site
http://www.techkudi.blogspot.com


Rajni said...

Hi,
Exactly where to put the div class code.
Is it in the Template-Html code or between the posts. I am a bit confused. Also, how to make it appear on every page. Can you tell me step by step.
Please reply
Thanks,


Sarah C. said...

Yeah, so basically you rock my world. Thanks for providing these instructions. I figured out how to put my AdSense in the side banner that was being used for my "about me" and the like. You should post how to do that also...it would have been super helpful instead of me playing with the code for 45 minutes.
Thanks though!!


John Smith said...

I still don't know how to put adsense on the left side on my blogger blog.
http://widgetsforfree.blogspot.com


Anonymous said...

As suggested by you to alter the adsense will get our account banned as it is against TOS. I do not want to risk reputed Indian stock Tips site which is trusted by a million.
Regards
www.indian-share-tips.com


G0zen said...

I know this old article but I still can't do it...hope you can help me because I m not am HTML pro...

please visit my site and give me your opinion...thanks.

http://freetop10tv.blogspot.com