我在移动网页的顶部有一个 AdSense 自适应广告单元。当 320x50 的广告填充此空间时,广告底部会出现额外的空白区域。提供 320x100 广告时没有空白区域。我没有为 div 元素定义大小,因此该单位应根据 Google 提供的任何广告进行调整。
如果转换 320x50 而非 320x100 的广告,是否可以折叠空白区域?
我认为这是一个常见问题,但我一直未能找到解决方案。预先感谢您的帮助。
我认为 Google 最初尝试提供 320x100 单元,但最终提供了 320x50 单元,留下了额外的空白。根据 Google 的说法:“为了帮助增加 320x100 广告尺寸的竞争,我们允许 320x50 展示广告出现在这种格式中。发生这种情况时,较小的广告将始终在顶部垂直对齐。”
最佳答案
因此,由于广告已经在容器中,请尝试以下操作:
.ad-wrapper {
width:320px;
height:50px;
overflow:hidden;
}
并在容器上添加 ad-wrapper
类。
<div class="ad-wrapper" align="center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Top_Responsive --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-xxxxxx" data-ad-slot="xxxxxxx" data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
希望它有用!
关于html - 如何删除 AdSense 广告下方的空白区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33073203/