Closed (fixed)
Project:
DFP Small Business (Google Ad Manager)
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Aug 2010 at 19:04 UTC
Updated:
29 Jan 2013 at 14:20 UTC
When I used Adsense I could just add HTML to align the AD to be centered in a block, but when I use this module the ADs are displayed aligned to the left. How can I change this to make the ADs display aligned to the center of the block?
For example:
<div align="center">AD CODE</div>
Thanks in advance!
Comments
Comment #1
jcisio commentedYou can add this in your template css:
Comment #2
HS commentedSuper! Thanks for the quick reply. Will give it a go and report back.
Comment #3
StuddMan commentedWas having same issue, that tweak works perfect, thanks!
Comment #5
HS commentedThis didn't work for me perhaps because the default alignment of the page is aligned to the left. So the AD slot is also aligned left of the block not centred. Any ideas folks?
Comment #6
HS commentedThe following css code makes it look aligned centred. But not sure if thats the right way to go. Do you guys see anything wrong in using it?
.gam-holder {
margin-left:10%;
margin-right:10%;
}
Comment #7
HS commentedOK. The above 10% margin alignment didn't work.
I have two block on the same page. One is a 728x90 on the top of the page and other 300x250 on the sidebar.
The sidebar 300x250 block displays correctly, and is centred when you use:
But the 720x90 is aligned to the left.
If I add 10% to the margin from left and right, it throws the sidebar blocks off but aligns the 728x90 almost centred.
Can someone please help?
Comment #8
HS commentedThere could be something in my theme's CSS that's throwing it off. Will investigate further and report back.
Comment #9
jcisio commentedAll elements are provided with classes and ID. You have block (maybe with class "content") > .gam-holder > .gam-banner. You have the same liberty as you insert the GAM code manually.
Comment #10
HS commentedI understand that all individual slots have classes and IDs but customising every block individually with CSS to align the AD centred horizontally defeats the purpose, eh?
Does anyone know why margin: 0 auto; works on every block but one? There has to be something to it, yeah?
It is not my theme as I thought.
Comment #11
jcisio commentedIt looks like your own theming problem.
Comment #12
wemmies commentedI had a similar problem and did:
.gam-holder {
margin: 0 auto;
text-align: center;
}
This centered the add in my right column.
Comment #13
wemmies commenteddamn proxy double post.
Comment #14
wemmies commentedproxy triple post sorry
Comment #15
jcisio commented