【发布时间】:2022-06-11 20:46:19
【问题描述】:
我想在桌面上制作限制为 90-250 像素高度和 250-1280 像素宽度的自适应广告。
所以,我查看了official Google documentation 并创建了如下广告代码。
<ins class="adsbygoogle"
style="display:inline-block;min-height:90px;max-height:250px;min-width:250px;max-width:1280px;width:100%;height:100%"
data-ad-client="ca-pub-0000"
data-ad-slot="000"></ins>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-000" crossorigin="anonymous"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
但是,使用此代码,仅显示 90 像素 x 1280 像素的广告。
所以我回到自适应广告并为广告添加了一个类来限制高度。
<ins class="adsbygoogle testad"
style="display:block"
data-ad-client="ca-pub-333"
data-ad-slot="333"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
.testad{
max-height:250px !important;
}
在这种情况下,Google Ads 会覆盖高度限制。
将展示宽度:100%,高度:280px 的广告。
谁能告诉我我做错了哪一部分?
谢谢
【问题讨论】: