备忘:先记录下谷歌广告的地址:

https://www.google.com/adsense/new/u/

我们使用谷歌广告代码后,往往会占用屏幕满屏,特别我们移动端的时候,那么就与我们自己网站设置的样式格格不入了。我们需要让他在我们设置的样式div内部,不让他跑出去。

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9065xxxxxxxxx5886"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block;<strong><span style="color: #ff0000;">width:90%;margin 0 auto;opacity:90%;</span></strong>"
     data-ad-client="ca-pub-9065242445049409"
     data-ad-slot="52xxxx658"
     data-ad-format="auto"
     data-full-width-responsive="<strong><span style="color: #ff0000;">false</span></strong>"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

代码中红色部分即使我们要修改的地方

style=”display:block;width:90%;margin 0 auto;ipcaity:90%;” 设置宽度取90%,自动居中定位,透明度90%。

data-full-width-responsive=”false” 谷歌代码给出的值为true,这个意思宽度铺满屏幕的宽度。所以这里我们要改成false.

[button color=”success” icon=”” url=”https://www.cyrilstudio.top/archives/391/” type=””]谷歌广告申请[/button]

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

插入图片