Hello,
How do you center Google Adsense ads? I have tired <center> and <div> tags.
Please help, anyone!?
I think you can try
<div class="text-center">
on the div(s) where the code is being inserted in the template(s) …
which is the bootstrap 3 style class (may already be in the style.css, not sure).
You can’t “style” the elements inside the AdSense iframe/text/graphic on the site. You *can* center the location it is placed inside of a div.
I don’t know what you mean by ‘case’ can you elaborate please?
On my sites, the ad in top bar, below article, and sidebar already “auto center” using the “responsive” AdSense code from Google.
I think Marius needs to know an example (a case) where you are having the ads NOT centered, such as a custom block of text, or what exactly. A link to page, post, or where you’re using the AdSense code on your site and if you’re manually putting into your template or using the Newspaper theme admin panel “AD” boxes to insert the code.
I am using the ad section in the theme pannel. Here’s a screenshot of what I’m trying to center (just the ad) http://pbrd.co/1maIfuV
Hm. Weird. On my two sites the “responsive” AdSense units are auto-centered in the sidebar on every page. See test site: http://ga-ga.com/ … and I didn’t put in any special code to center it. Note things will NOT auto-center when resizing the page, in some cases.
For best results may sure you choose the responsive / experimental ad units from your AdSense accounts and not the static pre-sized units.
Without seeing the page and the possible code conflict from another plugin you might be using, it’s hard to tell. Marius will ask for a link to your site to look at it.
It *should* center automatically.
You will need to login to my site as it is under development at the moment.
Whats your email address? I’ll send over the details?
@Marius I have sent my login details to contact@tagdiv.com with the subject as Center Adsense.
I’ll wait to hear from you.
hi,
use this css to center your add:
.td-g-rec-id-custom_ad_2 {
text-align: center;
}
or
.td-g-rec-id-custom_ad_2 {
position: relative;
left: 20px;
}
i have added the code here: http://screencast.com/t/ANWUFc8vi
Thanks for you message.
Radu A.
