备忘:先记录下谷歌广告的地址:
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]
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。