Center Adsense

Posted in: Newspaper
Post count: 249

Hello,

How do you center Google Adsense ads? I have tired <center> and <div> tags.

Please help, anyone!?

Post count: 9544

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.

Post count: 249

Didn’t work 🙁

Post count: 3343

Hi,
Only via CSS, show us your case, to inspect it.

Thanks!

Post count: 249

I don’t know what you mean by ‘case’ can you elaborate please?

Post count: 9544

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.

Post count: 249

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

Post count: 9544

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.

Post count: 3343

Hi,
@snowwatchGB i mean to give me a link to see the issue, to inspect it. And yes the ADS should be aligned in sidebar as default.

But do not worry, could be fixed via CSS.

Thanks!

Post count: 249

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?

Post count: 249

@Marius I have sent my login details to contact@tagdiv.com with the subject as Center Adsense.

I’ll wait to hear from you.

Post count: 854

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.

Post count: 249

Thanks — works a treat!

Viewing 13 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic.