vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   AdSense Advertisment Alignment (https://vborg.vbsupport.ru/showthread.php?t=326804)

alfuzzy 10-12-2018 01:35 AM

AdSense Advertisment Alignment
 
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

More Narrow page:

https://vborg.vbsupport.ru/external/2018/10/3.png

--------------- Added [DATE]1539318102[/DATE] at [TIME]1539318102[/TIME] ---------------

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">


All times are GMT. The time now is 01:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01026 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete