PDA

View Full Version : AdSense Advertisment Alignment


alfuzzy
10-12-2018, 01:35 AM
Can someone explain how do I get the Top adsense ad in the screenshot below to auto-center on the page please.

Both Ad Unit ads are using exactly the same AdSense code:

- The ad on top I created by pasting the AdSense Ad Unit code directly into the Ad template.
- The ad on bottom I created with the vBulletin Ad Manager.

For some reason the ad on top (where I pasted the ad code directly into the Ad template) is not auto-centering on the page.

If I adjust the width of the page...the bottom ad auto-centers...but the ad on top does not auto-center.

Thank you.:)

Wider Page:

https://vborg.vbsupport.ru/external/2018/10/2.png (http://s73.photobucket.com/user/pigoo3/media/Screen%20Shot%202018-10-11%20at%2011.15.16%20PM_zpsjefe7qvf.png.html)

More Narrow page:

https://vborg.vbsupport.ru/external/2018/10/3.png (http://s73.photobucket.com/user/pigoo3/media/Screen%20Shot%202018-10-11%20at%2011.25.57%20PM_zpssurtwcfa.png.html)

--------------- Added 1539318102 at 1539318102 ---------------

In case it helps...this is what the ad unit code looks like:


<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Header -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
data-ad-slot="XXXXXXXXXX"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

CharlieDelta
10-12-2018, 04:52 PM
Try wrapping the Adsense code with <center></center>. You can also use it in the VBulletin Ad Manager.

So your code will look like this;

<center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Header -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
data-ad-slot="XXXXXXXXXX"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>

alfuzzy
10-12-2018, 09:00 PM
Thanks very very much CharlieDelta...that did the trick. You da man!:)

rekha
10-17-2018, 07:05 AM
<div style="text-align:center">