在下面的链接这里中,我有3个广告,右/左/头广告。他们使用的是响应单元,状态是“活动的”,问题是响应性广告没有显示,谷歌显示这是由CSS主题引起的,也许Ad单元没有使用父div的大小。
我试过以下几种方法:
<div class="right-ad">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline"
data-ad-client="ca-pub-1588985522291479"
data-ad-slot="8975496541"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div> 2:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="right-ad"
style="display:inline"
data-ad-client="ca-pub-1588985522291479"
data-ad-slot="8975496541"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>CSS仍为空,如下所示(最小950 is ):
margin-right: 1%;
position: relative;
width: 13%;
height: 100%;
margin-top:1em;
float:right;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 4px, rgba(0, 0, 0, 0.0980392) 0px 0px 3px;为什么仍然是空白的?
编辑:
</div>
<div class="left-ad">
<script async
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1588985522291479"
data-ad-slot="8975496541"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>发布于 2016-05-27 11:59:40
<ins class="right-ad"
style="display:inline"你把这个添加到广告的HTML中了吗?你不应该改变广告代码。对于data-ad-format="auto",广告将适应容器的大小。只需删除添加到广告代码中的内容,然后改为更改容器。在您的例子中,<div class="right-ad"> div。
这就是普通广告代码的样子。
<div class="my-container" style="width: 500px; height: 300px">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-XXXXXXXXXXX"
data-ad-slot="XXXXXXXXXXX"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>所以,你的style="display:inline"应该是
style="display:block"https://stackoverflow.com/questions/37482785
复制相似问题