我目前正在尝试使用Google Adsense自适应广告,但是当屏幕尺寸超过特定尺寸时,有没有办法展示两个广告?
例如,当屏幕尺寸大于620像素时,会相互显示两个“250 x 250”广告(而不只是一个)?
答案 0 :(得分:1)
您可能不会放置两个广告(没有可能导致各种问题的服务器端编码),但您可以增加或减少广告的大小,以使用媒体查询实现类似的行为。例如:您可以显示 -
为此,您需要在“自适应广告”中使用高级代码(需要修改代码)。如下 -
<style>
.responsive2 { width: 300px; height: 250px; }
@media(min-width: 500px) { .responsive2 { width: 336px; height: 280px; } }
@media(min-width: 800px) { .responsive2 { width: 728px; height: 90px; } }
@media(min-width: 1200px) { .responsive2 { width: 970px; height: 250px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive2 -->
<ins class="adsbygoogle responsive2"
style="display:inline-block"
data-ad-client="ca-pub-XXXXX"
data-ad-slot="YYYYY"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
有关高级自适应广告的详细信息,请参阅https://support.google.com/adsense/answer/3543893#adv