What is the trick to getting the displayed ads to center themselves within the block? They come up fine, but only to the left of the block, and editting the CSS for the theme doesn't seem to work.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | centeradsenseinjector.png | 309.71 KB | fblevins |
Comments
Comment #1
zach978 commentedI second this, is there an easy way to do this?
Comment #2
yasYou can specify the position in a block in your css as follows:
or if you want to specify the position individually,
Comment #3
Oceria commentedIf you're not comfortable adding things to your css file you can use
<div align="center">[adsense ]</div>in the post itself.Comment #4
deepesh commentedAnother easy to implement way would be to use the Adsense Injector Module & use the template below under the "List ad insertion template: *" setting :
%teaser<div class="injected" style="text-align: center;">[adsense:468x60:1:1]</div>Comment #5
jcnventuraJust added some code to center the ads in the block.
João
Comment #6
tmancanada commentedI've just tried all of these suggestions, and all failed
Comment #7
bart3k commentedSame here. I don't understand how to do it. Help please....
Comment #8
bart3k commentedI want to be able to center the entire block, if you look at http://www.brawngpteam.com at the footer i need to center that block. Any way to do it?
Comment #9
jcnventuraDownload the latest dev version, and you'll have an option to center the ad in the block.
Comment #10
fblevins commentedThis is an old thread but I thought I'd throw my two cents in as I'd been looking for a way to do this and none of the methods I'd read in these forums worked (for me at least). So after walking away for a few hours and letting my mind settle I came back and did this:
1. Administer -> Site Configuration -> Adsense Injector -> Node body ad insertion template
2. Switch to source.
3. Enclose the adsense in center tags thus:
html center tag begin
#
html center tag end
(forum strips the center tags I tried to insert above)
You'll come out with your ad showing above your node as in the screenshot I'm attaching. One strange consequence is that my banner ads on my front page (which is populated by panels containing mini-panels containing views) display centered also. That's ok because that's the way I wanted it anyway, but if I'm logged in as administrator I strangely do NOT get this side-effect. Go figure! Anyhow, it works so I'm not gonna jack with it anymore unless or until it breaks!!!
Yeah, it's a hack, but it works. Like we said in the Army... "If it looks stupid but it works, it ain't stupid!"