Reputation: 121
My code:
<div style="style="display:block; float: left; margin: 0px 50px 0px px;>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Paragraph Ad 3rd - Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-xxxxx"
data-ad-slot="xxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
Google Adsense is perfectly centered in desktop, even when i resize the device:
But, When i test it on real mobile device, it is not centered:
Upvotes: 0
Views: 1055
Reputation: 26
Try this,
<div align="center" style="display:block; float: left; margin: 0px 50px 0px px;">
if that does not work then try this in the style attribute
text-align: center;
Upvotes: 1
Reputation: 26
you can put center tags around your Adsense code. Something like this:
<center>
<div style="style="display:block; float: left; margin: 0px 50px 0px px;>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Paragraph Ad 3rd - Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-xxxxx"
data-ad-slot="xxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</center>
Hope this helps man. Cheers.
Upvotes: 0