【发布时间】:2015-11-24 20:29:08
【问题描述】:
我在让 AdSense 广告出现在非固定宽度的 div 中时遇到问题。基本上,我有两个并排放置的 div,我希望 Google 广告出现在第二个中,它没有设置固定宽度。查看我的示例代码:
<div style="width:1000px">
<div style="float:left; width:200px">
test
</div>
<div style="float:right; overflow:hidden">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1234"
data-ad-slot="5678"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
Google 拒绝投放广告,但我收到以下错误:“找不到宽度=0px 的容器的响应尺寸”
任何想法如何解决这个问题?谢谢!
【问题讨论】:
-
你搜索过吗?同一个问题有很多问题。其中许多问题已经以一种或另一种方式解决了。
-
是的,我已经搜索过了——事实上我有两个相邻的 div,这使得这个比看起来更具体。我已经尝试设置超时或使用 onload 来调用广告,但这并没有成功。
标签: html responsive-design adsense